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.
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:
- Backup the system.
- Update existing packages and reboot the Debian 10 system.
- 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.
- Update the packages index on Debian Linux, run:
sudo apt update - Prepare for the operating system minimal system upgrade, run:
sudo apt upgrade --without-new-pkgs - Finally, update Debian 10 to Debian 11 bullseye by running:
sudo apt full-upgrade - Reboot the Linux system so that you can boot into Debian 11 Bullseye
- Verify that everything is working correctly.
Let us see all commands step by step to upgrade Debian 10 Buster to Debian 11 Bullseye safely 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.
lsb_release command:$ lsb_release -a
Here is what I see:
1 2 3 4 5 |
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:
1 |
Linux 4.19.0-18-amd64 x86_64 |
Also note down the Debian version:$ cat /etc/debian_version
Outputs:
10.11
Step 2. Update ALL existing installed packages
Any package in hold status will create a problem with upgrade procedure. Hence, list all packages hold from upgrades using the apt-mark command:$ sudo apt-mark showhold | more
# OR #
$ sudo dpkg --get-selections | grep 'hold$' | more
Then remove the host status for all listed packages one-by-one with the following command:$ sudo apt-mark unhold package_name
## OR ##
$ echo 'package_name install' | sudo dpkg --set-selections
See “apt-get hold back packages on Ubuntu / Debian Linux for more info. 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.
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:
1 2 3 4 5 6 7 8 9 |
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:$ sudo 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
1 2 3 4 5 6 7 8 9 |
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 with Linode mirror
Here is my updated APT config file AWS Lightsail/EC2 server:
1 2 3 |
deb http://cdn-aws.deb.debian.org/debian bullseye main deb http://security.debian.org/debian-security bullseye-security main deb http://cdn-aws.deb.debian.org/debian bullseye-updates main |
Updated /etc/apt/sources.list file for EC2 with AWS CDN
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:
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:
1 2 |
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:
1 2 3 4 5 |
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