Debian 10 to 11

By Darren Nathanael on Sun, Mar 13, 2022 / Updated at Sat, Feb 10, 2024

Just a quick blog for me since I have multiple server running debian 10.

If you are looking to update from Debian 11 to 12 read: blog.darrennathanael.com/posts/debian-11-to-12/

Prerequisites

The upgrade need to be done on a root account aka superuser.

Backup your data!!!

Before upgrading please backup your data. unless you like to play a russian roullete, and also have a backup server that auto backups everything u.u

Update Currently Installed Packages

Before upgrading, it is recommended to update the currently installed packages.

Packages marked as held back cannot be automatically installed, upgraded or removed. This may cause issues when upgrading to debian 11. To check wich package are held back, run the following command:

1apt-mark showhold

If there are on hold packages, you should unhold the packages with apt-mark unhold pkg_name.

Refresh the packages index and upgrade all installed packages:

1apt update
2apt upgrade

Run apt full-upgrade to perform a major version upgrade of the installed packages and may remove some unnecessary packages:

1apt full-upgrade

Remove the automatically installed dependencies that are no longer needed:

1apt autoremove

Upgrade Debian 10 Buster to Debian 11 Bullseye

Step one

Reconfigure APT’s source-list files.

You can either open the /etc/apt/sources.list file with your text editor and replace each instance of stretch with buster and buster/updates to bullseye-security. If you have other source list files under /etc/apt/sources.list.d, you need update those sources too.

The default file /etc/apt/sources.list should look something like this:

1deb [arch=amd64] http://ftp.ca.debian.org/debian/ buster main
2deb-src [arch=amd64] http://ftp.ca.debian.org/debian/ buster main
3
4deb [arch=amd64] http://ftp.ca.debian.org/debian/ buster-updates main
5deb-src [arch=amd64] http://ftp.ca.debian.org/debian/ buster-updates main
6
7deb [arch=amd64] http://security.debian.org/ buster/updates main
8deb-src [arch=amd64] http://security.debian.org/ buster/updates main

Update it so it looks something like this:

1deb [arch=amd64] http://ftp.ca.debian.org/debian/ bullseye main
2deb-src [arch=amd64] http://ftp.ca.debian.org/debian/ bullseye main
3
4deb [arch=amd64] http://ftp.ca.debian.org/debian/ bullseye-updates main
5deb-src [arch=amd64] http://ftp.ca.debian.org/debian/ bullseye-updates main
6
7deb [arch=amd64] http://security.debian.org/debian-security/ bullseye-security main
8deb-src [arch=amd64] http://security.debian.org/debian-security/ bullseye-security main

Alternatively, instead of manualy editing the files you can use the use the sed command:

1sed -i 's/buster/bullseye/g' /etc/apt/sources.list
2sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*.list
3sed -i 's#/debian-security bullseye/updates# bullseye-security#g' /etc/apt/sources.list

Step half way one

If you used sed you may notice that if you run apt update you will get an error message.

1E: The repository 'http://security.debian.org./debian-security 
2bullseye/updates Release' does not have a Release file.

The offending lines are this:

1deb http://security.debian.org/debian-security/ bullseye/updates main
2deb-src http://security.debian.org/debian-security/ bullseye/updates main

Note “bullseye/updates”, is where the error is. Change those two lines to look like this:

1deb http://security.debian.org/debian-security/ bullseye-security main
2deb-src http://security.debian.org/debian-security/ bullseye-security main

Step two

Update the packages index.

Set the terminal output to English only:

1export LC_ALL=C 

Update the bad boy:

1apt update
2apt upgrade

You may be asked if you want to restart or whether you want to keep an existing configuration file or to install the package maintainer’s version. Read the information carefully, and if you didn’t make any custom changes to the file, it is safe to type Y; otherwise, to keep the current configuration, enter N.

The upgrade may take some time, depending on the number of updates and your Internet speed.

Next, run apt full-upgrade, which will perform a complete upgrade of the system, install the newest versions of packages, and resolve dependency changes between packages in different releases. This will upgrade all packages that was not upgraded with the previous command.

1apt full-upgrade

The command may install some new packages and remove conflicting and obsolete packages.

After thats done, clean up the unnecessary packages with:

1apt autoremove

Finally, reboot your machine so that the new kernel is activated by typing:

1reboot

Confirm the Upgrade

Wait for a few moments until your system boots up and log in. You can check the Debian version by using the lsb_release command:

1lsb_release -a

Output:

1root@sandbox:/home/urmom# lsb_release -a
2No LSB modules are available.
3Distributor ID: Debian
4Description:    Debian GNU/Linux 11 (bullseye)
5Release:        11
6Codename:       bullseye

Thats it! gtfo and enjoy your new Debian 11.