Is there a path to upgrade an old Ubuntu 14.04.6 LTS?

I understand that opinions are not encouraged here, but this is not a request for an opinion. I would like to explain the situation.

I have inherited a VPS with Ubuntu 14.04.6 LTS, and I am currently facing a tragic-comedy scenario.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.6 LTS
Release:        14.04
Codename:       trusty

$ uname -r

In the past, I have successfully converted Ubuntu into Debian by modifying the repository and manually upgrading individual packages with caution.

I would like to seek your advice on this:

  • What is the more similar version of Debian and is it really possible to switch Ubuntu 14 into an old Debian ? I ask because I could remember bad, I’m not ready to tell I’m sure 100% to have done a switch in the past; it’s only something I remember
  • Is there a way in 2023 to upgrade the server to next LTS of ubuntu without doing the big jump to latest LTS?
Asked By: realtebo


I wouldn’t recommend transitioning between Ubuntu and Debian for that vintage due to the different init systems. Ubuntu 14.04 uses Upstart which Debian has never embraced.

You can upgrade to a newer Ubuntu. You need to do it one LTS release at a time, i.e. 14.04 → 16.04 → 18.04 → 20.04 → 22.04. This takes time, but the risk is low, especially on a server. The biggest source of trouble is usually third-party applications, and sometimes interactions between packages in universe. A typical VPS is less likely to run into trouble than a typical desktop.

Before you start, take a look at what the VPS is running and have a plan to handle dependencies on old software. For example, if you have some antique PHP code, first test whether it works with modern versions of PHP.

Preparing for the upgrade

All Ubuntu releases are archived on the old-releases server. So the first thing you need to do is to edit /etc/apt/sources.list to replace by Also make sure you have trusty-updates as a package source, and so on for the subsequent releases: often there are a few updates near the end of life of a release to fix problems encountered when upgrading to the next release. So your /etc/apt/sources.list should look like this:

deb trusty main restricted universe multiverse
deb trusty-security main restricted universe multiverse
deb trusty-updates main restricted universe multiverse

You may have multiple lines instead of one. You may be missing some of restricted, universe and multiverse: that’s also fine (and in fact the fewer you have, the fewer sources of potential problems, but of course they need to stay if you have any packages installed from those).

Then run any pending updates for this old release with

apt-get update
apt-get upgrade

At this point, I recommend keeping a history of your changes in /etc. You can do this very easily with etckeeper.

apt-get install etckeeper
etckeeper init
etckeeper commit 'Initial commit before upgrading from Ubuntu 14.04'

If you have any third-party repositories enabled (e.g. PPAs), you should disable them, uninstall the corresponding packages during the upgrade. If there are any such repositories, first comment out the corresponding lines in /etc/apt/sources.list or /etc/apt/sources.list.d/*. Run etckeeper commit to keep a log of your change. Then look for obsolete packages (obsolete packages are packages that you can’t reinstall from the current package sources):

apt-get install aptitude
aptitude search '~o'

You can use the interactive mode of aptitude if you prefer. Make a note of the obsolete packages, then uninstall them.

Upgrading from LTS to LTS

You’re now ready to start upgrading. Edit /etc/apt/sources.list and replace trusty (14.04) with xenial (16.04). Run etckeeper commit to keep a log of your change. Then run

apt-get update
apt-get dist-upgrade

There will be long periods of boredom while this downloads and installs packages, with the occasional question here and there.

If there are problems, resolve them as they come.

Once the upgrade is complete, repeat the procedure to upgrade to bionic (18.04). This one is still on the normal servers rather than the old-releases server at the time I write this answer, so in addition to replacing xenial with bionic, also replace with

Then repeat again to upgrade to focal (20.04) and then jammy (22.04).

Once this is done, if you had third-party repositories enabled, re-enable them or look for their modern equivalent. Reinstall the third-party applications that you removed before the upgrade, and if relevant upgrade the ones that you kept in /usr/local or the like. Test that everything works.

Dealing with expired keys and certificates

You may run into trouble with cryptographic verification due to expired keys or unknown root CAs.

If HTTPS package sources don’t work until you’ve upgraded to a non-antique releases, stick to HTTP package sources at the beginning.

If you get errors from APT about expired keys, you can bypass them. Alternatively, installing a keyring package from a more recent distribution might help, but I don’t know exactly what you would need. The ubuntu-keyring package contains a file /usr/share/keyrings/ubuntu-archive-removed-keys.gpg with the keys for old releases, in addition to /usr/share/keyrings/ubuntu-archive-keyring.gpg which has the keys for current releases.

Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.