Upgrading from an Ubuntu End-of-life release

I just finished a painful OS upgrade and wanted to document how I fixed it.

Symptoms

My first clue that something was wrong was when I tried:

sudo apt update

and saw a long list of 404 errors.

This was my most recent server purchase from 2022, so I was surprised. But sure enough, I checked the Ubuntu release page and found Ubuntu 22.10 "Kinetic Kudu" had been sunset.

Ubuntu EOL

The standard upgrade steps were:

sudo apt-get update
sudo apt-get dist-upgrade
sudo do-release-upgrade

but as I mentioned above, I was getting 404 errors on the first step.

Recommended solution #1

I located the EOLUpgrades page and replaced the contents of /etc/apt/sources.list with:

deb http://old-releases.ubuntu.com/ubuntu/ kinetic main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ kinetic-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ kinetic-security main restricted universe multiverse

Now I was able to update, but running sudo do-release-upgrade failed with this message:

An upgrade from 'kinetic' to 'mantic' is not supported with this tool.

Recommended solution #2

Fortunately, the bottom of the EOLUpgrades page has a section that describes this scenario: Ubuntu-unsupported.

So I tried following the steps:

wget http://archive.ubuntu.com/ubuntu/dists/mantic-updates/main/dist-upgrader-all/23.10.14/mantic.tar.gz
mkdir upgrader
tar -xaf mantic.tar.gz -C upgrader/
./mantic

This resulted in a very helpful core dump:

Feb 22 19:13:57 lynx kernel: [  274.385015] mantic[2623]: segfault at 18 ip 00007feb4b98bc04 sp 00007fff566946c0 error 4 in libgtk-3.so.0.2404.30[7feb4b884000+380000]
Feb 22 19:13:57 lynx kernel: [  274.385026] Code: c4 08 5b 5d c3 90 f3 0f 1e fa 48 8b 7f 10 48 85 ff 74 0b e9 be c8 ff ff 66 0f 1f 44 00 00 48 83 ec 08 48 89 d7 e8 bc 1e 17 00 <48> 8b 40 18 48 8b 78 10 e8 0f ff 08 00 48 83 c4 08 48 89 c7 e9 93

Actual solution #1

So I was stuck until I found this helpful Stack Exchange answer.

For the second time, I modified the contents of /etc/apt/sources.list with these lines:

deb http://archive.ubuntu.com/ubuntu/ lunar main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lunar-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ lunar-security main restricted universe multiverse

and successfully completed these steps:

sudo apt-get update
sudo apt-get dist-upgrade
sudo do-release-upgrade
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.04
Release:        23.04
Codename:       lunar

This is a reminder to myself to always install the latest LTS release for Ubuntu.

Except, Ubuntu 23.04 was at End-of-Life last month. SMH.

Here's an oddity: Ubuntu 23.04 has an End-of-life date of January 25, 2024, but Ubuntu 24.04 has a release date of April 2024. Seems wrong.

Actual solution #2

Despite the April 2024 release date (2 months from now), I decided to try the upgrade anyway.

For the third time, I modified the contents of /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ noble-security main restricted universe multiverse

I ran

sudo apt-get update
sudo apt-get dist-upgrade

which generated an error the first time:

Preparing to unpack .../dash_0.5.12-6ubuntu3_amd64.deb ...
Unpacking dash (0.5.12-6ubuntu3) over (0.5.12-2ubuntu1) ...
Setting up dash (0.5.12-6ubuntu3) ...
Removing 'diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash'
Removing 'diversion of /bin/sh to /bin/sh.distrib by dash'
This should never be reached
dpkg: error processing package dash (--configure):
 installed dash package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 dash
E: Sub-process /usr/bin/dpkg returned an error code (1)

I laughed out loud at this:

This should never be reached.

But it completed successfully the second time.

Ubuntu LTS, finally.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu Noble Numbat (development branch)
Release:	24.04
Codename:	noble

Whoops, it's not LTS, it's the development branch. But ok, I'll repeat this again in April.