1. Ensure your system is up-to-date in it’s current release
sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
  1. Replace the codename of your release with that of the next release in APT’s package sources:
    1. /etc/apt/sources.list
    2. The files in /etc/apt/sources.list.d/

As an example:

deb https://deb.debian.org/debian/ buster main

should be replaced with:

deb https://deb.debian.org/debian/ bullseye main

sudo nano /etc/apt/sources.list /etc/apt/sources.list.d/*
  1. Clean and update package lists
sudo apt-get clean
sudo apt-get update
  1. Perform the major release upgrade, removing packages if required

Interrupting this step after downloading has completed is a great way to stress-test your backups.

sudo apt-get upgrade
sudo apt-get full-upgrade
  1. Remove packages that are not required anymore

Be sure to review this list, you may want to keep some of them.

sudo apt-get autoremove
  1. Reboot your server to make the changes effective
sudo reboot
  1. Check the output of uname -a ; lsb_release -a and you should see info about the upgraded system

debian updating-software

This post was heavily inspired by, and borrows liberally from, the Debian Wiki.