Technology

How to upgrade Debian 10 to Debian 11 Bullseye using the CLI

There is no greater hope in human life than survival. At the same time, it is important to live well. With that in mind, every content on the website is written so that a person can get all the information from here to start his life to make beautifully.

According to that, Technology is one of the topics. It is also a part of life. Read carefully Details of Technology related article

How to upgrade Debian 10 to Debian 11 Bullseye using the CLI

I have Debian 10.10 installed on the AWS EC2 and Linode server. How do I upgrade Debian 10 Buster to Debian 11 Bullseye using the apt command or apt-get command safely? How can I upgrade Debian 10 to Debian 11 using ssh client?

Debian Linux 11 “Bullseye” has been released. The new version offers updated packages and five years of support. This page explains how to update Debian 10 Buster to Debian 11 Bullseye using command-line options, including upgrading all installed packages.

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Debian Linux 10
Est. reading time 7 minutes

What’s new in Debian 11?

  • Apache 2.4.48
  • Bash 5.1.4
  • BIND DNS Server 9.16
  • Emacs 27.1
  • GNOME desktop 3.68
  • KDE desktop 5.20
  • Libreoffice 7.0
  • Lighttpd 1.4.59
  • Linux kernel 5.10.0-8
  • LXDE 11
  • LXQt 0.16
  • MariaDB 10.5
  • MATE 1.24
  • Nginx 1.18
  • OpenSSH 8.4p1
  • Perl 5.32.1
  • PHP 7.4
  • Postgresql 13
  • Python 3.9.2 (default but one can install Python 2.7.18 if needed)
  • Rustc 1.48
  • Vi IMproved (VIM) 8.2
  • Xfce 4.16.

Upgrade Debian 10 to Debian 11 Bullseye

The procedure is as follows:

  1. Backup the system.
  2. Update existing packages and reboot the Debian 10 system.
  3. Edit the file /etc/apt/sources.list using a text editor and replace each instance of buster with bullseye. Next find the security line, replace keyword buster/updates with bullseye-security.
  4. Update the packages index on Debian Linux, run:
    sudo apt update
  5. Prepare for the operating system upgrade, run:
    sudo apt upgrade
  6. Finally, update Debian 10 to Debian 11 bullseye by running:
    sudo apt full-upgrade
  7. Reboot the Linux system so that you can boot into Debian 11 Bullseye
  8. Verify that everything is working correctly.

Let us see all commands step by step to upgrade Debian 10 Buster to Debian 11 Bullseye safetly running in the cloud or bare metal environment.

Step 1. Backup your system

Warning! Do not skip the backup step. The author and nixCraft are not responsible for data loss and failed installation.

It is crucial to back up all data and system configurations. Cloud-based VMs can be quickly backup and restore using snapshots. I use rsnapshot, which is the perfect solution for making backups on the local or remote servers. Check os version in Linux:
lsb_release -a
Here is what I see:

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

Note down the Linux kernel version too:
uname -mrs
My Linux kernel version:

Linux 4.19.0-18-amd64 x86_64

Also note down the Debian version:
cat /etc/debian_version
10.11

Step 2. Update ALL existing installed packages

Before you upgrade your Debian version to 11, you must apply all security patches and pending upgrades to Debian 10 itself. Therefore, type the following apt command or apt-get command:
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
sudo apt --purge autoremove

OR
sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
sudo apt-get --purge autoremove

Reboot the Debian 10.x buster to apply the kernel and other updates:
sudo systemctl reboot

Step 3. Update /etc/apt/sources.list file

Make sure you replace http://mirrors.linode.com/ APT URL mirror name with your actual mirror name.

 

Patreon supporters only guides 🤓

    • No ads and tracking

 

 

    • Join my Patreon to support independent content creators and start reading latest guides:

 

Join Patreon

Before starting the upgrade procedure, you must reconfigure APT’s source-list files. To view current settings using the cat command or more command
more /etc/apt/sources.list
Old Debian 10 APT config file:

deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main
 
deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main
 
# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main

Old Debian 10.x /etc/apt/sources.list file

The keyword buster indicates that we are using an older version 10. Hence, we must change all the references in this file from Buster to Bullseye using a text editor such as vim:
vi /etc/apt/sources.list
I prefer to use sed tool, but first backup all config files using the cp command:
sudo cp -v /etc/apt/sources.list /root/
sudo cp -rv /etc/apt/sources.list.d/ /root/

Edit the /etc/apt/sources.list file:
sudo vim /etc/apt/sources.list
Find the debian-security line for Buster:
deb http://mirrors.linode.com/debian-security buster/updates main
Replace with:
deb http://mirrors.linode.com/debian-security bullseye-security main
OR the following syntax is valid too:
deb http://mirrors.linode.com/debian-security bullseye-security/updates main
Then replace other buster line with bullseye in /etc/apt/sources.list and /etc/apt/sources.list.d/* directory. For example, find:
deb http://mirrors.linode.com/debian buster main
Replace with:
deb http://mirrors.linode.com/debian bullseye main
See updated file now:
cat /etc/apt/sources.list

Updating APT source list file to use Bullseye release

For your ready references, here is my updated APT config file that will update the system to Debian version 11:

deb http://mirrors.linode.com/debian bullseye main
deb-src http://mirrors.linode.com/debian bullseye main
 
deb http://mirrors.linode.com/debian-security bullseye-security/updates main
deb-src http://mirrors.linode.com/debian-security bullseye-security/updates main
 
# bullseye-updates, previously known as 'volatile'
deb http://mirrors.linode.com/debian bullseye-updates main
deb-src http://mirrors.linode.com/debian bullseye-updates main

Updated /etc/apt/sources.list file

Updating the package list

Then run:
sudo apt update

Step 4. Minimal system upgrade

A two-part process is necessary to avoid the removal of large numbers of packages that you want to keep. Therefore, first run the following command to apply:
sudo apt upgrade --without-new-pkgs

Just follow on-screen instructions. During the upgrade process, you may get various questions, like “Do you want to restart the service? ” OR “keep or erase config options” and so on. For example, I got a screen as follows indicating new changes:

APT listing changes and showing news about package updates. Make sure you read them.

Press ‘q‘ to exit and further you may see additional screens:

Make sure you choose the “Yes” option

Why do I get such prompts when upgrading system?

There are services installed on your system which need to be restarted when specific libraries, such as libpam, libc, and libssl, are upgraded. Since these restarts may cause service interruptions for the system, you will typically be prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid being prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked questions on each library upgrade.

Step 5. Upgrading Debian 10 to Debian 11

In addition, minimum upgrades we need to do full upgrades to finish the whole Debian 10 to Debian 11 update process. This is the main part of the upgrade. In other words, execute the following command to perform a complete upgrade of the system, installing the newest available versions of all packages, and resolving all possible dependency:
sudo apt full-upgrade

You may see additional prompts about restarting services or updating existing config options. Review those carefully too. For instance, I got an opportunity to update or keep the OpenSSH config file as follows:

What do you want to do about modified config file?

And you are done. It is time to reboot the Linux system to boot into Debian Linux 11 buster. Hence, run
sudo systemctl reboot
Outputs:

Connection to 45.xx.zzz.yyy closed by remote host.
Connection to 45.xx.zzz.yyy closed.

Try running the ping command to get notification when your server comes back online:
ping -a server_IP_here
ping -a 45.xx.zzz.yyy

Step 6. Verification

It is time to confirm the upgrade. Run:
uname -r
lsb_release -a

I get successful update confirmation:

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

After the upgrade, look out for all your apps and services. Therefore, verify all TCP/UDP ports are opened and services are running using the tail command or ss command or grep command/egrep command:

sudo ss -tulpn
sudo tail -f /var/log/mail.log
sudo tail -f /var/log/nginx/access_log
 
# look for errors if any
sudo grep 'error' /var/log/my_app/app1.log
sudo egrep -i 'err|fail|warn|crit' /var/log/nginx/python_app.log
 
# Check for service status
sudo systemctl status nginx.service
sudo systemctl status mariadb.service
 
# Use journalctl to query the contents of the systemd(1) journal
sudo journalctl
sudo journalctl -u sshd.service

A note about removing unwanted packages

WARNING! The following is an optional step. However, you must carefully review packages that are no longer needed on the system. Otherwise, the following command might break the system.

Finally, clean up outdated packages using the apt command/apt-get command:
sudo apt --purge autoremove

A note about missing drivers or firmwares blobs

When you update the system from Debian 10 to 11, specific firmware stored on your system is disabled. Look into the kernel modules directory under /lib/ for disabled firmware. For example, you may see a Qualcomm firmware file named firmware-6.bin.disabled from the last upgrade. Those files need to be installed or upgraded again and reboot the system. The same goes for proprietary drivers like NVidia. Hence, making backups and not panicking is essential.

Summing up

And there you have it. We have successfully upgraded to Debian Linux 11. Updated Debian 11 version always brings new features and hardware support via Linux kernel. Hence, one must evaluate needs and then do upgrades. Debian Linux project also posted an in-depth guide that explains other issues one might face during installation. Make sure your read man pages using the man command:
man apt
man apt-get

 


ADVERTISEMENT
 

 

Did you like this article?
Share it on any of the following social media channels below to give us your vote. Your feedback helps us improve.

Other related Technologies ideas you might enjoy

Related Articles

Leave a Reply

Your email address will not be published.