Debian 11, codename “Bullseye” was released on 14th August 2021. It is a stable release and is supported for the next 5 years. This release brings updates for many well-known packages, including Linux Kernel 5.10 LTS, Apache 2.4.48, MariaDB 10.5, Python 3.9.1, PostgreSQL 13, and more.
Before upgrading to Debian 11, you should do the following things:
- Back up all your files on the external drive.
- Make sure you have a stable internet connection.
- Disable any external repository.
In this article, I will show you how to upgrade from Debian 10 to the new Debian 11 in a few easy steps.
- A server that is running Debian 10.
- A root password is configured on the server.
Update the System
First, you must update and upgrade all your system packages to the latest version. Run the following command to update and upgrade all packages:
apt-get update -y apt-get upgrade -y apt-get dist-upgrade -y
Next, remove all unwanted packages with the following command:
Next, clean up the APT package cache with the following command:
Next, restart your system to apply all updates:
After restarting the system, verify your operating system version using the following command:
You should see the following output:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster
Update Debian 10 Repository with Debian 11
Next, you will need to update the Debian 10 repository with Debian 11 to download and receive the update.
To do so, you can update all source files by running these commands:
sed -i 's/buster\/updates/bullseye-security/g' /etc/apt/sources.list sed -i 's/buster/bullseye/g' /etc/apt/sources.list sed -i 's/buster\/updates/bullseye-security/g' /etc/apt/sources.list.d/*.list sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list
Or edit the APT source file manually with the following command:
Replace “buster/updates” with “bullseye-security”, and “buster” with “bullseye”. The result should be similar to the one below:
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-free
Save and close the file when you are finished if there are more APT source files in /etc/apt/sources.list.d/, edit these as well by replacing “buster” with “bullseye”.
Upgrade Debian 10 to Debian 11
At this point, your Debian 10 server is ready for the upgrade.
First, update the repository to apply the changes you made in the previous step.
apt-get update -y
Now we will update existing packages without installing new ones:
apt upgrade --without-new-pkgs -y
Once your repository is updated, run the following command to start the upgrade:
apt-get full-upgrade -y
Once your system has been upgraded, restart it to apply all the updates.
Verify Debian 11 Upgrade
At this point, your Debian 10 server is upgraded to Debian 11. You can now verify it using the following command:
You should see the Debian 11 version in the following output:
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye
In the above guide, we explained how to upgrade from Debian 10 to Debian 11. I hope you can now upgrade your Debian 10 without any hassle.