Debian 12 Bookworm has been released. If you are using Debian 11 "Bullseye", now is the time to consider upgrading your computer or server. However, it is recommended that you wait for the first minor release of Debian "Bookworm", version 12.1, before doing critical server upgrades.
Having said that, if you want to know about the new features of Debian 12, you can check this article. Here are the detailed upgrade steps:
Whether you are running Debian Server or any desktop version, make sure to back up critical data. For example, you may need to make a backup of your desktop documents. If it's a server, log the running services. You can do this using rsync
or other utilities.
Debian 12 introduces a new repository called non-free-firmware
for proprietary drivers and packages. If you use any "closed source" network, display, graphics or other drivers, you may need to configure them after upgrading.
For network drivers, be sure to log the contents of the /etc/network/interfaces
and /etc/resolv.conf
files somewhere securely. If you lose your network connection after the upgrade is complete, you can follow this guide to easily set it up.
Run the following command from the command prompt to ensure that Debian 11 has updated security and other packages:
sudo apt updatesudo apt upgradesudo apt full-upgradesudo apt autoremove
After completing the above command, restart the Debian 11 system:
sudo systemctl reboot
Write down some information about Debian 11. This is important for servers. They include kernel versions and Debian versions. This is because after upgrading, you can verify the same command below to ensure the upgrade was successful.
For example, the system I am trying to upgrade is Debian 11.7 and the kernel version is 5.10.
uname -mr
Sample output:
5.10.0-23-amd64 x86_64
cat /etc/debian_version
Sample output:
11.7
Back up the APT source files to any directory of your choice:
sudo cp -v /etc/apt/sources.list /home/arindam/sudo cp -vr /etc/apt/sources.list.d/ /home/arindam/
Open /etc/apt/sources.list
file and add the Debian 12 codename bookworm
to the file, replacing bullseye
.
sudo nano /etc/apt/sources.list
The following is the /etc/apt/sources.list
file in my test system The content of before the change is used as a reference:
deb http://deb.debian.org/debian/ bullseye maindeb-src http://deb.debian.org/debian/ bullseye maindeb http://security.debian.org/debian-security bullseye-security maindeb-src http://security.debian.org/debian-security bullseye-security maindeb http://deb.debian.org/debian/ bullseye-updates maindeb-src http://deb.debian.org/debian/ bullseye-updates main
The following It is the /etc/apt/sources.list file after the change. The following mirror URLs are the default settings. If you use different Debian mirrors, please do not change them:
deb http://deb.debian.org/debian/ bookworm maindeb-src http://deb.debian.org/debian/ bookworm maindeb http://security.debian.org/debian-security bookworm-security maindeb-src http://security.debian.org/debian-security bookworm-security maindeb http://deb.debian.org/debian/ bookworm-updates maindeb-src http://deb.debian.org/debian/ bookworm-updates maindeb http://deb.debian.org/debian bookworm non-free non-free-firmwaredeb-src http://deb.debian.org/debian bookworm non-free non-free-firmwaredeb http://deb.debian.org/debian-security bookworm-security non-free non-free-firmwaredeb-src http://deb.debian.org/debian-security bookworm-security non-free non-free-firmwaredeb http://deb.debian.org/debian bookworm-updates non-free non-free-firmwaredeb-src http://deb.debian.org/debian bookworm-updates non-free non-free-firmware
Note
: Starting with Debian 12 “Bookworm”, the Debian team created a new repository non-free-firmware to package non-free software packages. Therefore, they are also included in the last three sections in the example above. Save the file and exit.
Open a terminal and run the following command to start the upgrade process:
sudo apt updatesudo apt full-upgrade
升级过程
Debian 12 升级过程进行中
在升级过程中,安装程序可能会要求你重新启动几个服务。仔细阅读消息后点击 “Yes”。另外,如果你看到带有 :
的提示,请按 q
键退出该消息。
确认服务验证
等待软件包下载和安装完成。
升级完成后,请重新启动你的 Debian 桌面或服务器:
sudo systemctl reboot
重启后,请验证你是否正在运行 Debian 12。可以使用以下文件检查 Debian 版本:
cat /etc/debian_version
示例输出:
Debian 12 Bookworm Desktop (Xfce)
此外,如果你刚刚升级到 Debian 12 服务器,请确保验证正在运行的服务,例如 HTTP、SSH 等。你可以使用以下 systemd 命令 了解正在运行的服务:
systemctl list-units --type=service
在确认所有步骤都已完成后,你可能希望运行 apt autoremove
命令来清理不需要的软件包。但是,请在执行此操作时格外小心。
sudo apt --purge autoremove
这就是升级到 Debian 12 的简要步骤。希望你的升级顺利进行。请勿立即将关键的 Debian 11 服务器升级,等待 Debian 12.1 发布后再行操作。
有关 Debian 升级的更多信息,请访问 官方文档。
最后,请别忘了告诉我们你的升级情况。
The above is the detailed content of Upgrading from Debian 11 to Debian 12. For more information, please follow other related articles on the PHP Chinese website!