UPDATING END OF LIFE UBUNTU

It's quite common to deploy Linux based devices and just forget about them. But, what do you do when you need to make changes requiring an OS update and you hit the 'end of life' brick wall preventing software updates? This walkthrough documents how to jump over the wall.

I run a number of Ubuntu based LXC containers and other gadgets and gizmos that are often set up and basically forgotten about.
They are running various services that once deployed, just sit there, doing their thing.

Not exactly ‘best practice’ but, it is what it is. 

The problem with this approach is that I will occasionally miss End of Life notifications until after an Ubuntu version ends up being unsupported. This creates problems as Ubuntu seem to make it unnecessarily difficult to update once EoL has been passed.

I recently came across this when trying to update my PiHole instances that are running in LXC containers. Pi-Hole couldn’t update so some hoops had to be jumped through. I’m documenting this, mainly for my own reference but it will probably be of use to others as there doesn’t seem to be any ‘one stop shop’ for obtaining a solution.

The first thing you will notice when trying to update an EoL system will be messages about release files and being unable to update because it’s not secure:

Hitting the 'you need to update but you can't update' brick wall!

There are 2 issues here.

  1. The repository isn’t ‘secure’ because there is no release file.
  2. The address of the repository isn’t actually resolving (because it no longer exists).

To get around this you need to edit the sources.list file to change the address of the repository and also 'trust' that repository.

Open a terminal window or log in via SSH and enter the following command:

sudo nano /etc/apt/sources.list

This will load the sources.list file into the 'Nano' text editor:

EoL Ubuntu original sources.list

On each line, add [trusted=yes] between 'deb' and 'http' and replace the word 'archive' in the repository addresses with 'old-releases'.

After this is done, you should have something like this:

EoL Ubuntu - modified sources.list file

Please note the name of your release may well be different - DO NOT change the release name. At best it won't work. Worst case scenario you will completely bugger your installation.

Once the edits are complete (double check everything), do a [CTRL] O then [ENTER] to save the file and [CTRL] X to exit.

You should now be able to update your release with all outstanding updates with the following command:

sudo apt update && sudo apt dist-upgrade

Depending on how long ago you checked for update, it may take some time to pull in and install everything needed.

Once your 'old' version is as up to date as it can be, you can run the following command to download and upgrade to the next supported release version:

sudo do-release-upgrade 

Note - there will be various questions regarding the replacement of existing configuration files. If such files have been modified in any way, it is best to hit enter for each file. This will keep any changes that have already been made.

There will also be a bunch of confirmation stages - unless you want to review every change, just do a Y for everything. After a while, the install will ask for a reboot and you will be on the next release.

That's it!

Why this process doesn't actually appear to be documented is beyond me. Either that or my Google-Foo wasn't up to scratch!

Comments

You should also read:

The Lifelong Pursuit: Why Photography Still Captures Me

There are certain passions that stick with you—the ones that endure through new technology, different jobs, and the changing landscape of life. For me, that passion has always been photography. It's been a constant companion since I was a teenager, offering a unique way to see and interpret the world.