​How to Upgrade Debian 10 Buster to Debian 11 Bullseye

By 

Updated on

4 min read

Upgrade Debian 10 Buster to Linux Debian 11 Bullseye

After more than two years of development, the new Debian stable version, Debian 11 codenamed “Bullseye”, was released on August 14, 2021, and it will be supported for five years.

This release comes with a lot of new packages and major software upgrades. Debian 11 bullseye ships with Linux 5.10 LTS kernel with support for the exFAT filesystem and includes a newer version of desktop environments.

This article shows how to upgrade your Debian 10 Buster system to Debian 11, Bullseye via command line.

Prerequisites

The upgrade operation must be run with superuser privileges. You need to be logged in as a root or a user with sudo privileges .

Backup Your Data

First and foremost, make sure you backup your data before starting the major upgrade of your operating system. If you are running Debian on a virtual machine, it is best to take a complete system snapshot so you can quickly restore your machine in case the update goes south.

Update Currently Installed Packages

Before starting the release upgrade, it is recommended to update all your currently installed packages to their latest versions.

Packages marked as held back cannot be automatically installed, upgraded or removed. This may cause issues during the upgrade process. To check whether there are held back packages on your systems run:

Terminal
sudo apt-mark showhold

If there are on hold packages, you should either unhold the packages with sudo apt-mark unhold package_name or make sure the packages will not interfere with the upgrade process.

Refresh the packages index and upgrade all installed packages:

Terminal
sudo apt update
sudo apt upgrade

Run apt full-upgrade to perform a major version upgrade of the installed packages and may remove some unnecessary packages:

Terminal
sudo apt full-upgrade

Remove the automatically installed dependencies that are no longer needed by any package:

Terminal
sudo apt autoremove

Upgrade Debian 10 Buster to Debian 11 Bullseye

The first step is to reconfigure APT’s source-list files.

To do so, you can either open the /etc/apt/sources.list file with your text editor and replace each instance of buster with bullseye and buster/updates to bullseye-security. If you have other source-list files under /etc/apt/sources.list.d, you must update those sources too.

The default file /etc/apt/sources.list looks like this:

/etc/apt/sources.listini
deb https://deb.debian.org/debian bullseye main
deb-src https://deb.debian.org/debian bullseye main
deb https://security.debian.org/debian-security bullseye-security main
deb-src https://security.debian.org/debian-security bullseye-security main
deb https://deb.debian.org/debian bullseye-updates main
deb-src https://deb.debian.org/debian bullseye-updates main

Alternatively, instead of manualy editing the files you can use the use the sed commands below:

Terminal
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list
sudo sed -i 's#/debian-security bullseye/updates# bullseye-security#g' /etc/apt/sources.list

Set the terminal output to English only:

Terminal
export LC_ALL=C 

Once done, update the packages index:

Terminal
sudo apt update

If there are any errors or warning messages related to a third-party repository, try fixing the issue or disabling the repository.

Start the system upgrade by upgrading the installed packages. This will upgrade only those packages that don’t require any other packages to be installed or removed:

Terminal
sudo apt upgrade

You will be asked whether you want the services to be automatically restarted during the upgrade.

output
Restart services during package upgrades without asking?  

During the upgrade process, you may also be asked various other questions, like whether you want to keep an existing configuration file or to install the package maintainer’s version. Read the information carefully, and if you didn’t make any custom changes to the file, it is safe to type Y; otherwise, to keep the current configuration, enter N.

The upgrade may take some time, depending on the number of updates and your Internet speed.

Next, execute apt full-upgrade, which will perform a complete upgrade of the system, install the newest versions of the packages, and resolve the dependency changes between packages in different releases. This will upgrade all packages that were not upgraded with the previous command.

Terminal
sudo apt full-upgrade

The command may install some new packages and remove conflicting and obsolete packages.

Once done, clean up the unnecessary packages with:

Terminal
sudo apt autoremove

Finally, reboot your machine so that the new kernel is activated by typing:

Terminal
sudo systemctl reboot

Confirm the Upgrade

Wait for a few moments until your system boots up and log in.

You can check the Debian version by using the following command:

Terminal
lsb_release -a
output
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

That’s it. You can now enjoy your new Debian 11.

Conclusion

Upgrading from Debian 10 to Debian 11 is a relatively easy and painless process.

If you hit any error, visit the Release Notes for Debian 11 (bullseye) page, which covers the known issues that might happen during an upgrade to Debian 10 bullseye.

Tags

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page