How to fix Ubuntu/Debian apt-get 404 Not Found Package Repository Errors (Saucy, Raring, Quantal, Oneiric, Natty…)

Ubuntu End of Life Package Repository

If you’re using a normal version of Ubuntu such as Saucy, Raring, Quantal, Oneiric, Natty, Maverick, etc, you may have already (and will eventually) start getting “Failed to fetch 404 Not Found” errors when trying to run  apt-get update , or even sometimes running apt-get install , but fear not, it is easy to fix, and here’s how…

Why am I getting this error?

Normal Ubuntu releases are supported for 9 months, whereas LTS (Long Term Support) releases are supported for 5 years.  Once support is up for the version of Ubuntu you are using the repository is moved to another server and will no longer be available on the standard   http://archive.ubuntu.com/ubuntu/dist/ location.

Ubuntu Release Details

The most simple solution would be to upgrade to a newer version:

BUT, for some of us that isn’t an option right now, or maybe you don’t want to upgrade.  With a simple sed command you can update the  /etc/apt/sources.list file to use the new location for the old package repository.

How can I fix it without upgrading?

Run this command below on your server and it will replace all of the  archive.ubuntu.com  and  security.ubuntu.com package repository URLs with  old-releases.ubuntu.com

For Linux Mint, run this command as well:

You may also want to see if there are other files in  /etc/apt/sources.list.d/  that need to be updated, which can be done with a simple grep command:

Now update apt-get sources:

Profit!

 


 

Common 404 Errors

 

Myles

Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts

  • Gery M

    it did not solve my problem still the same error

  • Dania Parvez

    i am using ubutu 13.10.. it niether update nor install anything. As i tried the soln given above it gives same error.

  • Wenya Wang

    Same question for undoing it. The dist-upgrade works great after editing the sources.list file. Yet after reboot, the connection to repository fails again..

  • disqus_is_overvalued_techie_no

    Forget the trick — how did you get such amazing bash syntax highlighting?

  • Hugo A

    Thanks !

  • Thank you!

  • peliculiar

    WOW, that’s great, although I’ve broken the part of the sources that were still OK. I’m a Linux Mint Rebecca user. How can I undo that?

    • Matthew Rosov

      agreed – how do I undo these commands?

  • niyuzuku

    how to make it back to use the new release?

  • puccup

    I was reading this on one machine and doing the update on another. Took a while to figure out that | was a vertical bar rather than an L.

  • Marcos Carlevaro

    Thank you! Note: In my case, running on Amazon AWS, you need to edit sources.list to remove the reference to the amazon server, example: “us-east-1.ec2”.

  • Camilo Sapienza

    this contribution just help

  • When you hover over the code block, a bar will appear above it, in the right corner there are multiple icons that will either copy it for you, open in new window, etc.

  • 阿川先生

    Thank you so much! I’ve been working with an issue on Google Compute Engine for a while! You just saved my day! Soooo thanks!

  • Uto

    It didn’t fix my problem but it pointed out the inner causes of it so I could finally find my own solution. Thanks!

    • Gery M

      did you find your solution, i am stuck no solution

  • richardwicks

    Wait, I have a question:

    This appears to happen if you neglect to update your linux box for some time. Is that true?

    I ask this because I am running a basically stock version of Linux Mint 17.2 which I just installed maybe a month ago on a virtual machine, and haven’t really paid attention to it on the VM.

    Is this why it happens? Because I think a LOT of people are running into this problem for that reason alone. I never use this machine.

  • Stef

    Thank you so much!! This fixed my problems. You totally saved my day.

  • Arvind Bhardwaj

    Awesome, thanks 🙂

  • Velosophist

    Thanks Myles – this fixed the issues that my Saucy install was experiencing.

  • Valerii Tarasov

    Thanks a lot. It resolved my problem

  • Kudzanayi Mutamba

    thanx man. You deserve a BELLS

  • Jon Godden

    Obvious when explained by someone who knows. Thanks for clear solution that worked.

  • THANK YOU VERY MUCH! You have no idea how much I appreciate this. You have saved me from going absolutely insane!

  • Man, what a nightmare when the apt commands started to fail! Thanks for this tip 🙂

  • Carlos Fajardo

    Finally! thanks.

  • Dave Doesntmatter

    fixed my problem, thanks for posting this!

  • Benny Daon

    seems like the took the “archive” server down and now it’s “old-releases” – http://askubuntu.com/questions/352864/apt-get-update-not-working-not-found-ip-91-189-92-201-80

  • Andrei

    Finally something that works! Thanks!

  • Thanks! It works perfectly.

  • PC Electronics

    FINALLY! Somebody with a BRAIN on the INTERNET!Thank You; Thankyou, THANKYOUUH!! DAMNIT

  • albarin

    Thank you! Saved my day!!

  • Jorge

    Thank you! My Pear 8 is now better because Pear Software Center is working fine.
    Nice, very nice tip!
    You are de best!!

  • spobin

    Thanks!!

  • Cam

    Thank you sooooo muuuch, ive been searching for hours and now I finally have a solution!

  • AWC

    Excellent! Thank you for the useful tip. One would imagine that Linux Mint devs would roll out an update for aging distros to properly update the repositories.

  • panchodev

    Thanks for the info we the people around the world who cant afford new computer systems appreciate solutions to software issues with old but still useful hardware.

  • Oleg Sorokin

    You’ve made my day! Great!
    I didn’t want totally update my system for few packages only, and this article just saved me from it 🙂

  • Mohamad Atie

    This did not solve my issues..can I send you my sources.list? I can only access recovery-mode since my system won’t boot and I need to reinstall ubuntu-desktop but can’t!!! Your help would mean the world to me..Thanks.

    • Make sure you have internet and use vim or nano to manually edit the file and make the changes

  • Erwin Van de Glind

    Thans man a real life saver!!

  • Anonymous

    Thank you, you are a total life saver!!! (Googled a lot and visited a lot of sites before finding this)

  • SteveH

    Thankyou very much!

  • tyleha

    Woo! Worked on Linux mint 14 nadia. Though the second listed sed command found no file, the first did the trick.

  • cv

    Thanks. Linux Mint 15. I wasn’t able to install various packages lately. Now I can. I’m glad I found this page before trying the 99% other stuff on internet that doesn’t usually work. Good job.

  • Polydash

    You are a life saver !

  • Anoop Kulkarni

    It was annoying me for a while. I did not know the urls have changed. Thanks for the post

  • hjc1710

    OH MY GOD! OH MY GOD! OH MY GOD! You are the greatest person on this planet. I love you so much.

    I’ve been throwing my head against a wall for the past hour and a half just trying to install openssh-server on Linux Mint. I had no idea the old sources were moved when a new LTS came out!!!! I cannot thank you enough, you ended my immense confusion (I tried so many other fixes, thinking I was behind a proxy, I had invalid sources, etc.) and solved my problem.

    Again, you are amazing.

  • Herbert Bothetele

    The command worked fine but I had to append the file name(sources.list) at the end.

    Thank you.

  • personface

    thank you for posting the practical solution.
    most answers on forums explicitly claim upgrade as the only option.
    you’re correct to point out that oftentimes, upgrade is no option at all.
    for instance, i can’t upgrade since my graphics hardware is no longer supported.