This article will guide you on how to upgrade Debian 11 Bullseye to Debian 12 Bookworm.
Preparation
Unless you are a physical server, and a KVM-built VPS and cloud host that has not used an oddly customized or modified kernel, there is a chance that upgrading to a major kernel update will cause Grub to fail to load, so remember to back up your important data!
OpenVZ 6 and LXC architecture VPS cannot be upgraded because they do not have their own independent kernel.
Again, always back up your important data!
The following operations need to be done under the root user, please use sudo -i
or su root
to switch to the root user
Update your system
First you need to update your current system.
If the kernel has been updated, you can reboot to allow the latest kernel to take effect, or you can simply perform an upgrade.
Upgrade your system
First update the apt
source, replacing bullseye
with bookworm
.
For Debian 12 onwards, all packaged non-free firmware binaries (non-free) that Debian can distribute, such as certain drivers, have been moved to a new component in the Debian Archive, called non-free-firmware. If you are upgrading from an older version of Debian and need these firmware binaries, you should update the /etc/apt/sources.list
on your system to use this new component (source):
|
|
The default system apt
source file /etc/apt/sources.list
should look something like this:
|
|
Then we execute the update system again.
The update process will prompt whether some software needs to be restarted automatically, select Yes, and whether the configuration file of some software needs to be updated, select according to your situation.
In the apt-listchanges: News
screen you can press q
to exit.
During the update process you will be prompted if some software needs to be restarted automatically, select Yes to do so, and if the configuration file of some software needs to be updated, you can choose whether to update it according to your situation. Press enter to be considered as using the old configuration file.
In the apt-listchanges: News
screen you can press q
to exit.
Whether to restart the service automatically.
Whether to update the OpenSSH configuration file.
Note that some software updates may update the systemd
service configuration, in which case we can execute systemctl daemon-reload
to reload the configuration.
If you encounter the following error while upgrading.
|
|
Delete the empty file /var/lib/dbus/machine-id
and re-execute the command, it will be generated automatically when upgrading dbus
.
|
|
Remove unnecessary software and dependencies after updating:
We then use the reboot
command to reboot the system. After waiting patiently, check for the latest system version.