These are basic steps to upgrade Debian 10 to Debian 11.
Before upgrading it is recommended to have a system backup or snapshot just in case anything goes wrong. Many hosts have been upgraded with these steps without problems but it isn't impossible something will go wrong.
These steps also work for hosts running Proxmox (to upgrade Proxmox 6 to Proxmox 7).
Check for any held packages:
apt-mark showhold
To unmark packages as held:
apt-mark unhold $PACKAGENAME
Change all package source entries from Buster to Bullseye:
sed -i 's/buster\/updates/bullseye-security/g;s/buster/bullseye/g;s/py3\/debian\/10/py3\/debian\/11/' \
/etc/apt/sources.list.d/*.list /etc/apt/sources.list
Run an apt update
to get the new packages available.
apt update
In case its needed, an example package sources list (contents of /etc/apt/sources.list
):
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://deb.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security bullseye-security main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
If the server is running Proxmox, the GPG key needs to be updated:
curl -L https://enterprise.proxmox.com/debian/proxmox-release-bullseye.gpg | sudo apt-key add -
If the server is not running Proxmox the GPG key does not need to be added.
I prefer to upgrade the apt
and locales
packages first; previously I have had various issues if they were not updated before the rest of the system. To run the upgrade:
apt -y install apt locales
Dependant packages will also be upgraded; some updates may result in prompts due to configuration file changes. Review those changes and either install package maintainers version or keep your currently installed version and go back after upgrade to modify it if required.
Upgrade all other system packages:
apt -y dist-upgrade
As with the previous step, various packages will most likely result in prompts for configuration file changes.
Some packages for my environment need some fixups after upgrade.
After upgrade the sssd
database version has changed. The old database files need to be cleaned:
systemctl stop sssd
rm -rf "/var/lib/sss/db/*"
systemctl start sssd
The sudo
configuration file has syntax changes. Using visudo
to edit /etc/sudoers
the diff of the changes are:
-# See sudoers(5) for more information on "#include" directives:
-
-#includedir /etc/sudoers.d
+# See sudoers(5) for more information on "@include" directives:
+@includedir /etc/sudoers.d
The backports kernel can be optionally installed. The backports mirror must be present in the sources.list
files to do this (see the top of the page for example sources.list).
Do not do this if the server is running Proxmox.
apt -y -t bullseye-backports install linux-image-amd64
Various old packages that are no longer required can be cleaned up:
apt --purge autoremove
The system can now be rebooted. After boot Debian Bullseye should be working.
After reboot I like to run another full upgrade and autoremove step to make sure nothing was missed:
apt -y dist-upgrade
apt --purge autoremove