Ubuntu upgrade


Upgrade from 20.04 to 22.04

25 Feb 2024

Preparation

Ensure system is up to date:

apt update
apt upgrade
apt autoremove
reboot

Stop backup and mirroring of sage so that I have a reference copy of the system before the update:
chmod -x /etc/cron.hourly/fog_back
chmod -x /etc/cron.hourly/fog_mirror

Closed applications that I had running and disconnected VNC from mugwort.

Upgrade

The upgrade itself was done talking directly to sage (using TV as display).

Following these instructions I attempted to upgrade using GUI application:

update-manager -c

This seemed to be proceeding OK - downloaded packages (don't know where to) and apparently started to install them, but then everything froze. I had to reboot.

I tried using:

do-release-upgrade

But this didn't work since the previous attempt at upgrading had been interrupted. However, doing:

lsb_release -a

showed that to the system had been switched to Ubuntu 22.04, and the file /etc/apt/sources.list showed 'jammy' (the 22.04 repository) as the main source.

So I proceeded with the upgrade using:

apt upgrade
apt autoremove
reboot

Whenever I was prompted about modified configuration files, I opted to keep my old version. It seemed simpler to edit them after the upgrade rather than during.

The system rebooted but several issues were immediately apparent - see below

Clean up

Issues

Several issues were apparent after the upgrade:

Further investigation showed that many packages (over 150) had not been upgraded, and the system had been left with inconsistent dependencies.

I tried:

apt --fix-broken install

but this complained about dependency problems without actually fixing them.

After studying many forum threads without finding any simple solutions, I developed a strategy of repeatedly doing:

apt upgrade
apt autoremove

with occasional:

dpkg --force-all --remove <packages>

to forcibly remove one or two packages that appeared to be causing dependency problems.

At one point I also tried adding the 'focal' (20.04) repositories to '/etc/apt/sources.list', in addition to the 'jammy' (22.04) repositories, followed by an 'apt update'. This may have helped, but this wasn't clear.

I got to a stage where 'apt upgrade' was "holding back" about 30 packages - I don't know why. I used 'apt install' to install these in small groups or sometimes singly. Attempting to install them all together caused obscure errors.

Edit configuration files

The following configuration files under /etc had 'dpkg-dist' files created - i.e. new versions of the files:

Unless noted above, I created a new version of each of these files, merging my changes with the 'dpkg-dist' file.

Re-enable repositories