Upgrading from Debian 11 to Debian 12

王林
Release: 2023-06-14 17:23:52
forward
2751 people have browsed it

从 Debian 11 升级到 Debian 12

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:

Upgrading from Debian 11 to Debian 12

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
Copy after login

After completing the above command, restart the Debian 11 system:

sudo systemctl reboot
Copy after login
Copy after login

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
Copy after login

Sample output:

5.10.0-23-amd64 x86_64
Copy after login
cat /etc/debian_version
Copy after login
Copy after login

Sample output:

11.7
Copy after login

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/
Copy after login

Open /etc/apt/sources.list file and add the Debian 12 codename bookworm to the file, replacing bullseye.

sudo nano /etc/apt/sources.list
Copy after login

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
Copy after login

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
Copy after login

从 Debian 11 升级到 Debian 12

##Update source files

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
Copy after login

升级过程

从 Debian 11 升级到 Debian 12

Debian 12 升级过程进行中

在升级过程中,安装程序可能会要求你重新启动几个服务。仔细阅读消息后点击 “Yes”。另外,如果你看到带有 : 的提示,请按 q 键退出该消息。

从 Debian 11 升级到 Debian 12

确认服务验证

等待软件包下载和安装完成。

升级完成后,请重新启动你的 Debian 桌面或服务器:

sudo systemctl reboot
Copy after login
Copy after login

检查升级状态

重启后,请验证你是否正在运行 Debian 12。可以使用以下文件检查 Debian 版本:

cat /etc/debian_version
Copy after login
Copy after login

示例输出:

从 Debian 11 升级到 Debian 12

Debian 12 Bookworm Desktop (Xfce)

此外,如果你刚刚升级到 Debian 12 服务器,请确保验证正在运行的服务,例如 HTTP、SSH 等。你可以使用以下 systemd 命令 了解正在运行的服务:

systemctl list-units --type=service
Copy after login

总结和清理

在确认所有步骤都已完成后,你可能希望运行 apt autoremove 命令来清理不需要的软件包。但是,请在执行此操作时格外小心。

sudo apt --purge autoremove
Copy after login

这就是升级到 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!

Related labels:
source:51cto.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template