Upgrading Legacy Versions of Ubuntu

The standard Ubuntu versions go EOL quite quickly and it’s easy to miss the upgrade window such that running do-release-upgrade yields:

An upgrade from 'groovy' to 'impish' is not supported with this tool.

In this example, Ubuntu is looking to upgrade from 20.10 to 21.10 skipping 21.04 which is not supported. You’ve probably also reached a situation where you cannot even upgrade your current packages as the repositories have also been EOL’d and do not exist.

To upgrade step-wise, we need to upgrade our current platform first. You need to be logged in as root or using sudo for all of the following.

Start by changing your mirror in /etc/apt/sources.list to use old-releases.ubuntu.com. For example, in my case my mirror was ie.archive.ubuntu.com and so I can replace that via:

sed -i -e 's/ie.archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

Once that’s done, upgrade your current system as usual:

apt-get update
apt-get dist-upgrade
shutdown -r now

Now that your current system is up-to-date, we need to do a distribution upgrade to 21.04 hirsute (in my case). do-release-upgrade will still not work so we need to manually download the upgrade tool and run that ourselves. Find the appropriate UpgradeTool file from Ubuntu’s meta-release page here. In my case the appropriate upgrade file was hirsute.tar.gz and I downloaded that via:

wget http://archive.ubuntu.com/ubuntu/dists/hirsute-updates/main/dist-upgrader-all/current/hirsute.tar.gz

You now need to extract and run the tool:

mkdir hirsute_files
cd hirsute_files
tar zxf ../hirsute.tar.gz
./hirsute

If you’re as fortunate as me, this will run cleanly just as it would have via do-release-upgrade. If you have no more intermediary versions, you can do the final upgrade via do-release-upgrade as normal. Remember also that upgrading from one LTS version to another is also supported by that tool.

9 thoughts on “Upgrading Legacy Versions of Ubuntu”

  1. Dear Mr O’Donovan,
    I was exactly in this situation and I saw your blog just in time and I was able to upgrade to 21.04.
    Thank you very much.
    Sincerely
    Gurdyal

    1. Also I’d like to suggest for
      ———————-
      mkdir hirsute
      cd hirsute
      tar zxf ../hirsute.tar.gz
      ./hirsute
      ———————-

      1. If DIRECTORY can be CAPITAL letters it will differentiate the upgrade program ./hirsute from DIRECTORY HIRSUTE . I got confused and was trying to run DIRECTORY and missed hirsute program in while going through contents of directory.
      2. I needed to run with ROOT permissions, therefore used sudo and everything went fine.
      3. Don’t know why but apt-get worked for me instead of apt. apt gave me strange errors.
      4. I had some packages on HOLD which should be UNHELD before running/upgrading, it didnt really create any issues but the message was being given and I was concerned of breaking something.
      5. Thanks again. I just thought of sharing so it may help others 🙂
      Regards
      Gurdyal

  2. Thank you!
    I was in the same situation.
    Gambled and did it all over ssh to a Pi4 I won’t have access to for a while.
    It worked!

  3. Thank you so much! I have to say, I am kind of disappointed we have to hack our way to upgrade, even though I am the genius who did not upgrade his OS for so long (they could at least provide your mini-tutorial).

    Regardless, you are a life-saver.

  4. Thank you for helping me out of a very uncomfortable situation with my virtual server, which has been neglected for a little too long.

  5. Hello, thank you a lot for the guide. I’d missed the 21.04 deadline and could use it to upgrade to Impish 21.10.

    Just for the record, after changing the repo to old-releases.ubuntu.com I just did an
    apt-get update

    and then a

    do-release-upgrade

    Regards,

Comments are closed.