How to upgrade to Debian 11 from Debian 10

x


Just recently, Debian 11 has been released as a new stable release of this great Linux distribution. On a desktop user it might be common to do a clean install of the system, but on a server or workstation probably not. So this post will show you how to upgrade from Debian 10 to Debian 11 easily.

With each new Debian release comes new features that we can use to get the most out of our system. In the case of Debian version 11, some of the most important ones are

  • The presence of the 5.10 kernel so that much newer hardware will be better supported.
  • For those who use Debian on the desktop we have new versions of the desktop environments and therefore of its tools. Debian 11 includes GNOME 3.38, KDE Plasma 5.20, Xfce 4.16, and more.
  • In the server area, where Debian is very popular, key packages like PostgreSQL, MariaDB, Apache, Nginx, or PHP have been updated. But not only that but a lot of other packages.

Of course, this is a very brief review of what’s new in Debian 11 but the reality is that there are a lot of new features and you can check them out at this link.

Back up all your data

The Debian upgrade process is one of the safest in existence due to the stability of the distribution, but sometimes things go wrong. So it’s a good idea to make a backup of all your data but also of the system so that you don’t lose anything and above all have the option of going back.

For this, you have two ways: do a full disk clone where Clonezilla can be of great help, or simply save the data on another drive with the help of tools like Luckybackup or GRsync.

In any case, this step is highly recommended to avoid possible data loss.

Last but not least, you have to keep in mind that you should remove all external repositories as a precaution. The more software you have installed, the more likely it is to crash.

So, let’s go for it.

Upgrading from Debian 10 to Debian 11

Now open a terminal or if you are remote, connect to your server.

An essential step is to upgrade all the packages in the distribution and remove the unneeded ones.

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove

This ensures that there are no orphaned packages and that we are using updated packages from the Debian 10 branch.

The next step is to change the system repositories to point to Debian 11.

So, the file we need to modify is /etc/apt/sources.list.

sudo nano /etc/apt/sources.list

And you have to change the contents of the file to this one

deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb https://deb.debian.org/debian-security bullseye-security main contrib

Save your changes and close the editor.

Refresh the APT cache to load the new repositories.

sudo apt update

Now do a minimal version upgrade. In this case, only the installed packages will be updated but no new ones will be removed or installed. Don’t worry, this is a step before the final upgrade.

sudo apt upgrade – without-new-pkgs

During the process, you may notice that some screens will appear. In case you want to restart the services without asking, answer yes.

Now update the entire distribution and upgrade with the command

sudo apt full-upgrade

This step will update the whole system and you will see some screens asking if you want to keep the current configuration of some services like SSH. For security reasons you should keep them

At the end of the process, reboot the system.

sudo reboot

After rebooting the system, you can run the following command in the terminal to verify that the upgrade was successful.

cat /etc/debian_version

Sample Output

11.0

This way you can upgrade to Debian 11 without any problems. I hope you found it useful.

Conclusion

In this post, you have learned how to upgrade from Debian 10 to Debian 11 using a few commands. The process is simple but there can always be some problems so it is recommended that you always make a backup of the most important things.

So, share this post and help us to grow.