26.6 C
Wednesday, September 22, 2021

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

Must read

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” is going to release soon. 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 5 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.
  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-17-amd64 x86_64

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

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

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
Sample outputs:

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

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/
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*
### see updated file now ###
cat /etc/apt/sources.list

Updating the package list

Then run:
sudo apt update

Patreon supporters only guides 🤓

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare
  • Join my Patreon to support independent content creators and start reading latest guides:

Join Patreon

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:

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


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

Reboot the Linux system to boot into Debian Linux 11 buster, issue:
sudo reboot

Step 6. Verification

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

Sample outputs:

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

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

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.


Source link

- Advertisement -

More articles


Please enter your comment!
Please enter your name here

- Advertisement -

Latest article