HOW TO UPGRADE TO NEXT DEBIAN VERSION - jessie+🔗

Upgrade everything currently installed🔗

Run the following commands:

apt update
apt list --upgradable
apt upgrade
apt dist-upgrade

Run these - they should have empty output:

dpkg -C
apt-mark showhold
dpkg --audit

Disable and uninstall the previous version of puppet🔗

Now to make sure that puppet is off, disabled, and uninstalled. This will prevent weird behaviour during upgrade:

systemctl stop puppet
systemctl disable puppet
apt remove --purge puppet puppet-common
crontab -e # Remove check_puppet crontab

Edit APT sources🔗

Replace previous version from sources.list:

# From jessie to stretch
sed -i 's/jessie/stretch/g' /etc/apt/sources.list
sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/*
# From stretch to buster
sed -i 's/stretch/buster/g' /etc/apt/sources.list
sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*
# From buster to bullseye
sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*

This replaces the previous version sources with the next version sources.

Upgrade to next version🔗

Run the following commands:

apt update
apt upgrade
apt dist-upgrade
Jessie specific issues🔗
APT::Default-Release🔗

The error looks something like this:

E: The value 'jessie' is invalid for APT::Default-Release as such a release is not available in the sources

You can fix the issue by editing the following file: /etc/apt/apt.conf.d/release

Replace jessie with stretch.

sed -i "s/stretch/jessie/g" /etc/apt/apt.conf.d/release 

You should then be able to continue with your upgrade.

There is no public key available🔗
W: There is no public key available for the following key IDs:
AA8E81B4331F7F50

You simply have to install or update a package:

apt-get install debian-archive-keyring

Thereafter you can run apt-get update and resume with the upgrade.

If you run out of space, and stuff breaks: Increase the disk size, and run the following commands:

dpkg --configure -a # Should continue installation of packages.
apt --fix-broken install # Should fix any packages that were broken during installation.

After this, if there are still updates available (apt update && apt list --upgradbale), you should continue as normal:

apt upgrade
apt dist-upgrade

Notes🔗

The versions from jessie and newer are close enough in relevance that packages usually don't need changing, not much at least. If you go from Jessie to Buster+, a suggestion for apache would be to allow TLSv1.3.

A reboot is recommended for the new kernel to replace the old one, and so on. After a reboot, you can run the following to see if there are any packages that can and maybe should be removed:

apt update
# If you want to remove the packages:
apt autoremove