不重装从Ubuntu切换到Debian

/ 0评 / 1

手上有一个LXC小鸡,由于他的性价比,一直没舍得丢,但是无奈只有Ubuntu模板,我又喜欢Debian系统,LXC又无法自己重装,就算下载LXC官方的tar.gz覆盖也无法启动,只能考虑如何转Ubuntu为Debian了.

第一步安装Ubuntu系统,这个很简单,面板操作.

第二步,下载最新Debian源GPG签名包,并安装.

wget http://ftp.us.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.3_all.deb
dpkg -i debian-archive-keyring_2023.3_all.deb

第三步,替换源文件.

deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware

deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware

deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free-firmware

第四步,反复多次安装和更新,直到没有数据可以更新.

apt update
apt upgrade

第五步,删除一些Ubuntu软件.

apt purge cpp-9 gcc-10-base gcc-9-base libcbor0.6 libicu66 libjson-c4 libllvm10 libntfs-3g883 libprocps8 libpython3.8-minimal libpython3.8-stdlib libssl1.1 libxdmcp6 ntfs-3g plymouth plymouth-theme-ubuntu-text -y
rm /var/lib/update-manager -rf
rm /var/lib/ubuntu-release-upgrader -rf
rm /etc/lsb-release -rf
rm /etc/update-motd.d/10-* /etc/update-motd.d/50-motd-news -rf
rm /etc/profile.d/01-locale-fix.sh -rf

第六,做一些微调.

cat >/etc/motd <<EOF

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
EOF

如果要想更加剔除Ubuntu的东西,可以把全部组件按Debian源来重装一遍.

apt --reinstall install $(dpkg -l | grep "ii" | awk '{print $2}') -y

至此,你拥有一个从Ubuntu转过来的Debian.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注