How to Upgrade from Debian 10 to Debian 11

Debian 11, codename "Bullseye" has been released on 14th August 2021. It is a stable release and is supported for the next 5 years. This release brings updates to 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.
  • Stop all running application services including, Apache, FTP, and others.

In this article, I will show you how to upgrade from Debian 10 to the new Debian 11 in a few easy steps.

Prerequisites

  • A server running Debian 10.
  • A root password is configured on the server.

Update the System

First, you have to 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:

apt-get autoremove

Next, clean up the APT package cache with the following command:

apt-get clean

Next, restart your system to apply all updates:

reboot

After restarting the system, verify your operating system version using the following command:

lsb_release -a

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, edit the APT source file with the following command:

nano /etc/apt/sources.list

Remove all lines and add the following lines:

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.

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 that you have made in the previous step.

apt-get update -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.

reboot

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:

lsb_release -a

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

Conclusion

In the above guide, we explained how to do an upgrade from Debian 10 to Debian 11. I hope you can now upgrade your Debian 10 without any hassle.

Share this page:

Suggested articles

5 Comment(s)

Add comment

Comments

By: JohnnyBeGood at: 2021-08-23 13:36:03

Thank you! Hopefully there will be one for Apache and ISPConfig????

By: bch at: 2021-08-23 13:51:20

I really think it's wise to use the official upgrade guide instead to avoid possible issues:

https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html

By: thctlo at: 2021-08-26 12:24:54

if may give a small advice. change this from to.. 

apt-get upgrade -yapt-get dist-upgrade -y apt-get upgrade -dy && apt-get upgrade -yapt-get dist-upgrade -dy && apt-get dist-upgrade -y

This way, if for some reason the upgrade fails and you lots your network, all needed packages are now already on your system so that helps to recover it. (speaking out of experiance)  ;-) 

By: thctlo at: 2021-08-26 12:26:39

in addition 

apt-get autoremove apt-get autoremove --purge

or even better 

apt-get dist-upgrade -y --autoremove --purge

By: Randy Harris at: 2021-09-09 18:46:07

Great read!!!  I used your article to validate my proposed path to do an inplace upgrade for one of my servers.  The only thing omitted by me was the lsb_release command.  Other than that, the debian upgrade path today is much easier than it was in the past.

Great work and best wished in the future.