3n6xka
Last Updated: August 02, 2017
·
24.53K
· jameswyse
5d7031cae1f36c2cbbd4b812a24709d9

Fix apt on old unsupported Ubuntu releases

After discovering an old server that was still running Ubuntu 11.10 I found that apt-get was no longer working as support for this version ended 9 months after it was released, quite some time ago!

I was seeing errors from apt-get update like:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/main/source/Sources  404  Not Found

And errors from apt-get upgrade like:

Err http://archive.ubuntu.com/ubuntu/ oneiric-updates/main ncurses-bin i386 5.9-1ubuntu5.1
403  Forbidden

Since the server isn't quite ready to be replaced I had to find a temporary solution.

Luckily ubuntu provides a repository for old releases, aptly named old-releases.ubuntu.com.
To use it, open /etc/apt/sources.list with your favourite text editor (you'll need to be root or use sudo) and replace all occurrences of archive.ubuntu.com or security.ubuntu.com with old-releases.ubuntu.com.

My sources.list now looks like this:

deb http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric-updates universe
deb http://old-releases.ubuntu.com/ubuntu oneiric-security main
deb-src http://old-releases.ubuntu.com/ubuntu oneiric-security main
deb http://old-releases.ubuntu.com/ubuntu oneiric-security universe
deb-src http://old-releases.ubuntu.com/ubuntu oneiric-security universe

After you have updated the sources run an update:

$ sudo apt-get update

If you're still getting any 404 or 403 errors then double check your sources are correct. Otherwise you should now be able to upgrade your packages:

$ sudo apt-get upgrade

The above solution should work for Ubuntu releases as old as 4.10 (warty), though I haven't tested this.

You can avoid this problem in the future by using only LTS (long term support) releases which are supported for 5 years.

Say Thanks
Respond

6 Responses
Add your response

16024
B2ee8e7f0391350988253a7b2f1eecb7

Thank you!! I spent the past hour trying to get my oneiric instance to install python-dev. The 403 Forbidden errors were driving me crazy!

over 1 year ago ·
17006

Yes, this works. Thanks !

over 1 year ago ·
17535
7b1a295f7e8bccd5d8b9fdc0a3bf9a0b

Great! Thanks for sharing.

over 1 year ago ·
17632
None

Thank you. I have a basic server for which I just needed one package (for now) and this solved my problems. Marcos

over 1 year ago ·
28342

Replacing all occurrences of archive.ubuntu.com and security.ubuntu.com with old-releases.ubuntu.com in the etc/apt/sources.list file was the missing piece of the puzzle to get the pesky warning triangle to disappear from the upper panel in my no-longer-supported Ubuntu 10.04 Lucid Lynx installation. Thank you!

12 months ago ·
29160

You are a life saver.
I have an old PC which haven't been used for like 10 years, and it's birth is 1999.
I wanted to test if it still work and it did, even with newest Debian 9.1.
However, Mesa has droped 3D support for many old cards including mine 'Creative 3D Blaster Savage 4 32mb - AGP' with Mesa 8.
So, the only way to resurrect an accelleration on this PC was with a system that had Mesa 7.11 or earlier, and my system of choice become Mint 12. However, after installation, I saw issues with repositories, couldn't install anything, sad thing.
And now I found your description of how to fix it, thank you very much!!

Mate is too heavy, but now I can install 'Awesome', JWM or LXDE :)

4 months ago ·
Filed Under