Upgrade Debian 10 Buster to Debian 11 Bullseye: A Step-by-Step Guide

This step-by-step tutorial will show you how to safely upgrade Debian 10 Buster to Debian 11 Bullseye from the command line.

On August 14th, 2021, the Debian project finally released a stable version of Debian 11 Bullseye after over two years of development. It comes with many new features as most of the software in this version has been updated.

Furthermore, Debian 11 will receive support for the next five years just like any other Debian stable version.

But let’s now focus on how you can upgrade from Debian 10 Buster to Debian 11 Bullseye. The process is simple and assumes you are running in the root account.

1. Backup Your System

Please make sure to back up your data. The Debian upgrades are usually safe, but there is always a chance something may go wrong. Therefore, you must have your valuable data safely copied to a backup location, so you can restore it if there are any problems or complications.

You can manually copy important files to a different device (second hard disk, USB drive, another computer on the network, etc.).

You can also create a complete system image of your current Debian installation with a dedicated system imaging software like CloneZilla. If you wish to use any other backup software, you are free to do so. Just make sure your data are placed in a safe location.

2. Update All Currently Installed Packages

Before upgrading from Debian 10 to Debian 11, it’s important to ensure your currently installed Debian 10 system is up to date. Run the following apt commands in the terminal.

apt update
apt upgrade
apt full-upgrade

Now you can clean any leftover packages.

apt --purge autoremove

Then reboot your Debian 10 for the changes made to apply.

reboot

3. Check the Currently Installed Version

Now we will start by verifying that we are currently using the latest Debian 10.x point release.

The easiest way to check what Debian version you are running is to read the content of the /etc/debian_version file.

cat /etc/debian_version
10.10Code language: CSS (css)

An alternative way is by use of the lsb_release command. You can use it to display LSB (Linux Standard Base) information about the Linux distribution.

lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

4. Replace Debian 10 with Debian 11 Repositories

The Debian software repositories are defined in the /etc/apt/sources.list file and the /etc/apt/sources.list.d/ directory. Before starting the upgrade procedure, you must reconfigure them to point to the Debian 11 Bullseye repositories.

It is a good practice before updating the software repositories to backup the current software source list first.

mkdir ~/apt
cp /etc/apt/sources.list ~/apt
cp -r /etc/apt/sources.list.d/ ~/aptCode language: PHP (php)

Now you can proceed and update the current Debian 10 Buster repository to point to Debian 11 Bullseye repositories.

sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*Code language: PHP (php)

The commands shown above will replace the buster keyword with bullseye in software repositories files.

In Debian 11 Bullseye, the security suite is now named bullseye-security instead of bullseye/updates. So you need to locate the following debian-security  lines in the  /etc/apt/sources.list file:

deb http://security.debian.org/debian-security bullseye/updates main
deb-src http://security.debian.org/debian-security bullseye/updates mainCode language: JavaScript (javascript)

And replace them with these:

deb https://deb.debian.org/debian-security/ bullseye-security main
deb-src https://deb.debian.org/debian-security/ bullseye-security mainCode language: JavaScript (javascript)

The final sources.list file should look like the ones below.

cat /etc/apt/sources.listCode language: PHP (php)
deb http://deb.debian.org/debian bullseye main
deb-src http://deb.debian.org/debian bullseye main

deb http://security.debian.org/debian-security/ bullseye-security main
deb-src http://security.debian.org/debian-security/ bullseye-security main

deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates mainCode language: JavaScript (javascript)

5. Perform a Minimal System Upgrade First

At this point, your Debian 10 system is ready for the upgrade. The next step is to update the repository to let the system recognize the newly added repo URLs.

apt update

In some cases, doing the full upgrade might remove the large number of packages you want to keep. So the Debian developers recommend a two-part upgrade process to avoid the removal of the packages.

  • Part 1: Minimal system upgrade
  • Part 2: Full system upgrade

In the minimal upgrade, you will update and upgrade all the available packages without installing or removing any other packages.

To perform the minimal system upgrade first, run the command shown below.

apt upgrade --without-new-pkgsCode language: JavaScript (javascript)

Keep an eye on the screen. If the apt-listchanges package is installed, it will show important information about upgraded packages in a pager after downloading the packages.

Press q after reading to exit the pager and continue the upgrade.

Debian 10 to Debian 11 Upgrade

In addition, you will be asked if you want to restart services without asking.

Debian 10 to Debian 11 Upgrade

You will also be asked what you want to do with a specific configuration file. If you’re unsure what to do, go with defaults by pressing Enter key.

6. Upgrade Debian 10 to Debian 11

Once the minimal system upgrade is finished, run the following command to begin the full upgrade.

apt full-upgrade

Do not leave the system unattended because the upgrade process requires various inputs.

You can reboot the system once the Debian 11 upgrade process is completed.

reboot

Log in to the system and check your Debian version.

cat /etc/debian_version
11.0Code language: CSS (css)

Or as an alternative way by using the lsb_release command:

lsb_release -a
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

Congratulations! You have successfully upgraded your system from Debian 10 Buster to Debian 11 Bullseye. Your system will now be running Debian 11 Bullseye.

7. Cleaning up Debian 10 Obsolete Packages

It is a good idea to clean your newly upgraded Debian 11 Bullseye system by removing old obsolete packages that are now leftover from your successful upgrade and are not needed anymore.

apt --purge autoremove
apt autoclean

Conclusion

The above tutorial taught you how to upgrade Debian 10 Buster to Debian 11 Bullseye. Now you can enjoy the latest packages and hardware support provided by the latest Debian release.

We have tried to make this tutorial as simple as possible. Thanks for using it.

For additional help or useful information, we recommend you to check the official Debian upgrade documentation.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%