3

I have an a Raspberry Pi 4 running Ubuntu 21.10-server arm6. I just learned that it reached its EOL after trying to update/upgrade the software. I actually forgot that the installed system is not LTS(shows how rarely I touch its terminal). I'm running some services on this server and already forgot how I configured it(that was Q1 of 2021), so I prefer to just upgrade it instead of re-installing everything from scratch.

eSPiYa
  • 149
  • 1
  • 2
  • You can find instructions on upgrading here: https://help.ubuntu.com/community/JammyUpgrades – Lacek Jul 27 '22 at 07:11

1 Answers1

4

Solution

Edit your /etc/apt/sources.list and replace http://ports.ubuntu.com/ubuntu-ports by http://old-releases.ubuntu.com/ubuntu/. Then, re-run the commands.

Step by step:

  • Save a backup of /etc/apt/sources.list (althought you can also comment lines with #, but a backup is better for your own reference to leave the system as it was, just in case)
  • Replace the URLs in /etc/apt/sources.list by using http://old-releases.ubuntu.com/ubuntu/ instead of http://ports.ubuntu.com/ubuntu-ports
  • Run sudo apt-get update, which should run fine now.
  • Run sudo apt-get dist-upgrade, which should also run fine now.
  • And finally, run do-release-upgrade (a reboot might be needed before running this command)

Hopefully that should be it. Feel free to disable all failing sources in your sources.list until you successfully upgrade the system.

Context on what is going on

I've just ran into this very same issue and remembered ubuntu keeps a separate archive for old unsupported/retired releases. Once a release is retired, all the packages are removed from the main repo URLs.

Just to give a little bit of background the first problem I encountered was when I ran sudo apt-get update I was getting errors like this:

Err:9 http://ports.ubuntu.com/ubuntu-ports impish Release
  404  Not Found [IP: 185.125.190.39 80]

I've got similar problem when trying to run sudo apt-get dist-upgrade

E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/s/systemd/libpam-systemd_248.3-1ubuntu8.6_arm64.deb  404  Not Found [IP: 185.125.190.39 80]

It turns out ubuntu impish/ubuntu 21.10 was retired, so it could not be found in the main ubuntu archive.

Next thing I remembered/figured out, was that there was this old-releases.ubuntu.com so I decided to give it a try. It turns out it worked.

Conceptually, the only thing to be done was to replace the URLs and rerun the commands. See the top of this solution for the detailed steps.

NOTE: Take into account that it is not only about changing the domain name in the sources.list, but also about setting the right folder for the ubuntu package urls. In this specific case, at the time this was written, the URL is:

http://old-releases.ubuntu.com/ubuntu/

PS: If you find some inaccuracies in this solution, or other edge cases let me know. I'll be more than happy to fix them.

More information:

If something fails (e.g do-release-upgrade fails,...) or in case you want to better understand what is going on, please have a look at this page:

psanchez
  • 41
  • 1
  • My `/etc/apt/sources.list` had (without me editing previously) `http://ports.ubuntu.com/ubuntu-ports` instead of `http://ports.ubuntu.com/ubuntu` => `sudo sed -i 's/ubuntu-ports/ubuntu/g' /etc/apt/sources.list` fixed the problem. – Ronald Luc Aug 27 '22 at 22:34
  • This is the right solution for standard PC installations as well as Pi ones. The URLs to be changed won't have `ports` in them though. – ahcox Sep 06 '22 at 22:15
  • What are people supposed to do about the security urls? – Owl Sep 22 '22 at 09:59