Upgrade from Debian 10 to Debian 11
Step-by-step guide for the major release upgrade from Debian Buster to Bullseye.
In this tutorial I'll explain step by step how to upgrade from Debian 10 to Debian 11. No data will be lost, of course, and you can keep using the system exactly as before.
First, let's check our version again:
hostnamectlNext we update everything:
apt update && apt full-upgrade -yNext, the package cache has to be cleared:
apt cleanAfter that, we of course need to change the repository. This can be done either via command:
sed -i 's/buster/bullseye/g' /etc/apt/sources.listor manually in /etc/apt/sources.list:
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-freeOnce everything is changed, we can update all packages. For a major upgrade the Debian release notes recommend a two-step process: first a "minimal" upgrade (without new packages), then the full upgrade. This reduces the risk of conflicts:
apt update
apt upgrade --without-new-pkgs -y
apt full-upgrade -yThis can take a while. Once it has finished, we can reboot the server:
rebootOnce the server is back up, we check the Debian version:
hostnamectlIf it now says Debian 11, everything worked correctly. We remove the no longer needed packages and reboot the server once more afterwards:
apt-get autoremove -y
rebootOnce the server is back up again, we update the packages one more time:
apt update && apt full-upgrade -yThe upgrade from Debian 10 to Debian 11 is now successfully completed.