Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign raring-updates/universe Sources/DiffIndex
Err raring-security/main Sources
  404  Not Found [IP: 80]
Err raring-security/universe Sources
  404  Not Found [IP: 80]
Err raring-security/main amd64 Packages
  404  Not Found [IP: 80]
Ign raring-updates/main amd64 Packages/DiffIndex
Err raring-security/universe amd64 Packages
  404  Not Found [IP: 80]

W: Failed to fetch  404  Not Found [IP: 80]

W: Failed to fetch  404  Not Found [IP: 80]

W: Failed to fetch  404  Not Found [IP: 80]

W: Failed to fetch  404  Not Found [IP: 80]

Visiting does confirm that raring packages are indeed gone, while lucid, precise, saucy, and trusty are still there, as per their promised support schedule.

Some googling reveals that they're not deleted, but simply moved to, sort of a graveyard for insecure and unsupported packages.

To make apt-get update work, we simply need to edit /etc/apt/sources.list and update all URLs from and to point to, as per the following sed command:

sudo sed -i.bak -r 's/(archive|security)' /etc/apt/sources.list

After this, sudo apt-get update seems to run without a hitch. Of course if you do this, you're accepting to use an insecure system, and should do sudo apt-get install update-manager-core; do-release-upgrade as soon as possible.


Copy link

chaps commented Jun 1, 2015

I would like to add this link in case you get NO_PUBKEY error:

Copy link

aduycuong commented Jan 6, 2016

Thanks so much!

Copy link

uniquegeek commented Feb 11, 2016

+1 I have a mess of distros, drives, and desktops installed and this is getting me towards sorting it out and fixing it.

Copy link

tobek commented Feb 27, 2016


Another issue you may run into is if your machine is an AMI from AWS, in which case after running that sed command I found my sources were referring to URLs like

I was able to fix this by opening up /etc/apt/sources.list and simply deleting all instances of us-east-1.ec2.old-releases. - seems like the host had everything I needed, and from there I could update, upgrade, and then sudo do-release-upgrade

Copy link

gercaceres commented Mar 30, 2016

Thanks men!

Copy link

fanzhoulll commented Apr 8, 2016

Finally find a useful answer...really getting tired of the nonsense on stack overflow asking you to do sudo apt-get update..
Thanks dude!

Copy link

ment commented Sep 30, 2016

Great tip. Also, if you continue having problems like me trying to upgrade Ubuntu 10.04, try removing the us.subdomain if you have it. Like this to

Copy link

fagiani commented Jul 5, 2017

This is life saving for legacy machines.

Copy link

davis-byamugisha commented Sep 22, 2017

Amazing, it worked. Thanks!

Copy link

Xunnamius commented Dec 4, 2017


Copy link

realtebo commented Dec 25, 2017


What to do for canonical repos ?

Err vivid/partner amd64 Packages                                       
  404  Not Found [IP: 80]

Copy link

Bacham commented Jan 21, 2018


Copy link

TaeheeYoo commented Jan 22, 2018

Thank you so much!!

Copy link

IRGC commented Feb 16, 2018

root@de2 ~ # apt-get install mediainfo
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmediainfo0v5 libmms0 libtinyxml2-4 libzen0v5
Suggested packages:
The following NEW packages will be installed:
libmediainfo0v5 libmms0 libtinyxml2-4 libzen0v5 mediainfo
0 upgraded, 5 newly installed, 0 to remove and 48 not upgraded.
Need to get 1,931 kB/1,984 kB of archives.
After this operation, 6,944 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 yakkety-updates/universe amd64 libzen0v5 amd64 0.4.33-3ubuntu0.16.10.1
404 Not Found
Err:2 yakkety/universe amd64 libmediainfo0v5 amd64 0.7.88-1
404 Not Found
Err:3 yakkety/universe amd64 mediainfo amd64 0.7.88-1
404 Not Found
E: Failed to fetch 404 Not Found
E: Failed to fetch 404 Not Found
E: Failed to fetch 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

i update the sources.list url hostname to old-releases but still not working what to do?

Copy link

mikhaildubov commented Mar 17, 2018

This saved me a lot of time, thanks!

Copy link

tiwansh commented Apr 15, 2018

Thanks a ton ! This rescued me. :)

Copy link

tbvinh commented Aug 12, 2018


Copy link

Owl3 commented Sep 2, 2018

For me i had to change all the to

Without that /ubuntu/ on the end it couldn't find the packages.

I am trying to upgrade the parabuntu distribution on the parallella.

Copy link

realtebo commented Sep 2, 2018

My 2 coins:

sudo sed -i.bak -r 's/(archive|security).(ubuntu|canonical).com/' /etc/apt/sources.list

Copy link

portgasray commented Apr 10, 2019


Copy link

bscout9956 commented Jun 27, 2019

Don't forget the extras :)
sudo sed -i.bak -r 's/(extras|archive|security).(ubuntu|canonical).com/' /etc/apt/sources.list

Also, it may be necessary (if you are having troubles with your region being in the url) to place your region code right before archive and security

For my region that would be (br = Brazil):
sudo sed -i.bak -r 's/(extras|br.archive||canonical).com/' /etc/apt/sources.list

It seems to work just fine. ?Hopefully doesn't break the extras?, if so, you should probably disregard this comment.

Copy link

Insidexa commented Feb 18, 2020

you safe my life )) legacy project ) thx

Copy link

shikam commented Apr 27, 2020


root@shai-pc:/etc/apt/sources.list.d# apt-get update
Err:1 disco InRelease
Could not resolve ''
Err:2 disco-updates InRelease
Could not resolve ''
Err:3 disco-backports InRelease
Could not resolve ''
Get:4 disco-security InRelease [97.5 kB]
Get:5 disco-security/main i386 Packages [176 kB]
Get:6 disco-security/main amd64 Packages [188 kB]
Get:7 disco-security/main Translation-en [77.3 kB]
Get:8 disco-security/main amd64 DEP-11 Metadata [37.6 kB]
Get:9 disco-security/main DEP-11 48x48 Icons [12.9 kB]
Get:10 disco-security/main DEP-11 64x64 Icons [27.4 kB]
Get:11 disco-security/main amd64 c-n-f Metadata [5,000 B]
Get:12 disco-security/restricted amd64 Packages [1,560 B]
Get:13 disco-security/restricted Translation-en [628 B]
Get:14 disco-security/restricted amd64 c-n-f Metadata [116 B]
Get:15 disco-security/universe i386 Packages [280 kB]
Get:16 disco-security/universe amd64 Packages [283 kB]
Get:17 disco-security/universe Translation-en [86.0 kB]
Get:18 disco-security/universe amd64 DEP-11 Metadata [19.9 kB]
Get:19 disco-security/universe DEP-11 48x48 Icons [14.3 kB]
Get:20 disco-security/universe DEP-11 64x64 Icons [49.7 kB]
Get:21 disco-security/universe amd64 c-n-f Metadata [6,652 B]
Get:22 disco-security/multiverse i386 Packages [1,624 B]
Get:23 disco-security/multiverse amd64 Packages [1,460 B]
Get:24 disco-security/multiverse Translation-en [1,000 B]
Get:25 disco-security/multiverse amd64 c-n-f Metadata [116 B]
Fetched 1,368 kB in 1s (1,018 kB/s)
Reading package lists... Done
W: Failed to fetch Could not resolve ''
W: Failed to fetch Could not resolve ''
W: Failed to fetch Could not resolve ''
W: Some index files failed to download. They have been ignored, or old ones used instead.

i update the sources.list url hostname to old-releases but still not working what to do?

Copy link

filipmihal commented May 8, 2020

Thanks a lot! ❤️

Copy link

ths2 commented Aug 5, 2020

Thanks a lot!
Take some BATs!
Agradecimentos sinceros.

Copy link

tacianosilva commented Apr 24, 2021

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment