1

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
5.19.2-x86_64-linode156

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?
1
  • 1
    based on the "14" - i.e., 2014, that was between wheezy(7) and jessie(8), however, the kernel being 5.19, that's even later than bullseye (11), so I wouldn't want to try converting to bullseye, maybe with bullseye-backports? Personally, I'd hop on the LTS train and do 16.04.7, 18.04.6, 20.04.6 LTS then 22.04.2 LTS - surely ubuntu would let you do that Jul 4, 2023 at 10:38

1 Answer 1

3

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 archive.ubuntu.com by old-releases.ubuntu.com. 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 http://old-releases.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu 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 old-releases.ubuntu.com with archive.ubuntu.com.

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.

3
  • What about apt-get install update-manager update-manager-core ? Are these no more needed?
    – realtebo
    Jul 4, 2023 at 13:44
  • 1
    @realtebo They might smooth up the upgrade. But I have no idea if they work when upgrading to a release that's no longer on archive.ubuntu.com. Jul 4, 2023 at 15:05
  • Great Answer +1,000 if I could but 1 is all I can muster.
    – eyoung100
    Feb 15 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .