LINUXMAKER, OpenSource, Tutorials

How to update Debian Linux 10 "Buster" to Debian Linux 11 "Bullseye"?

At the time of this writing, Debian Buster is already the OldStable version, while Debian Bullseye is already the stable version. Debian 11 Bullseye was set to stable in August 2021.
However, the procedure from an oldstable version to a stable version in Debian Linux is always the same. This procedure should be recorded and documented here.

Bullseye Full Upgrade

First, we're doing a full full upgrade of the existing Debian Stable System - currently Buster, which can be a bit more up-to-date with you.

# apt-get update
# apt list --upgradable

This updates the package lists and displays available updates without installing them.

# apt-get -y upgrade
# apt-get -y dist-upgrade

This brings the current stable system up to date. You can also omit the option "-y", but you will then be asked interactively whether the actions should be carried out. The above chain of commands updates the information from the repositories, updates all packages, but does not delete one. The last command performs a system upgrade that allows both packages to be installed and deleted.

Prepare the Package Repository on Debian "Bullseye"

As already said, this statement can be applied to any Debian version, regardless of the versions "Buster" and "Bullseye". In the next step we prepare the /etc/apt/sources.list for the upgrade.

# sed -i 's/buster/bullseye/g' /etc/apt/sources.list

After that, your /etc/apt/sources.list should look something like this:

deb ftp.de.debian.org/debian/ bullseye main
deb-src ftp.de.debian.org/debian/ bullseye main
deb security.debian.org/debian-security bullseye/updates main
deb-src security.debian.org/debian-security bullseye/updates main

Then we bring our system up to date with the Bullseye repository.

# apt-get update

System-Upgrade to Debian-Bullseye

The following commands will upgrade your Debian 10 Buster to a Debian 11 Bullseye.

# apt-get -y upgrade
# apt-get -y dist-upgrade

Check which Debian version is running on your Linux system

The easiest way to check which Debian version you are running is simply to read the contents of the /etc/issue file.

# cat /etc/issue
Debian GNU/Linux 10 \n \l

However, the above command does not show you the latest Debian upgrade versions. In the following example, the command already provides more detailed information:

cat /etc/debian_version
10.8

In the next step, you can also look through the release file /etc/os-release:

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Another alternative is lsb_release, which may need to be installed first. Subsequently, this command also provides information about the Debian version on your Linux system.

# aptitude install lsb-release
#lsb_release -da
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:       10
Codename:       buster

For Debian versions that already use Systemd, you can also use hostnamectl:

#hostnamectl
   Static hostname: mombasa
         Icon name: computer-VM
           Chassis: vm
        Machine ID: 9e413e5b509343bc9a10c97172a75658
           Boot ID: 71224c76c174487abad3a9979a632ef4
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.9.0-8-amd64
      Architecture: x86-64