How to fix Ubuntu/Debian apt-get 404 Not Found Package Repository Errors (Saucy, Raring, Quantal, Oneiric, Natty…)
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…
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.
The most simple solution would be to upgrade to a newer version:
1 |
sudo apt-get dist-upgrade |
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.
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
1 |
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list |
For Linux Mint, run this command as well:
1 |
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list.d/official-package-repositories.list |
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:
1 |
grep -E 'archive.ubuntu.com|security.ubuntu.com' /etc/apt/sources.list.d/* |
Now update apt-get sources:
1 |
sudo apt-get update |
Profit!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Err http://archive.ubuntu.com quantal/main amd64 Packages 404 Not Found [IP: 91.189.91.15 80] Err http://archive.ubuntu.com quantal/restricted amd64 Packages 404 Not Found [IP: 91.189.91.15 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/main/binary-amd64/Packages 404 Not Found [IP: 91.189.91.15 80] W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/quantal-security/restricted/binary-amd64/Packages 404 Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com raring-security/main amd64 Packages 404 Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com raring-security/restricted amd64 Packages 404 Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com raring-security/universe amd64 Packages 404 Not Found [IP: 91.189.91.15 80] Err http://security.ubuntu.com raring-security/multiverse amd64 Packages 404 Not Found [IP: 91.189.91.15 80] |
-
Gery M
-
Dania Parvez
-
Wenya Wang
-
disqus_is_overvalued_techie_no
-
Hugo A
-
PC Ready Chile SpA
-
peliculiar
-
Matthew Rosov
-
-
niyuzuku
-
puccup
-
Marcos Carlevaro
-
Camilo Sapienza
-
Myles McNamara
-
阿川先生
-
Uto
-
Gery M
-
-
richardwicks
-
Stef
-
Arvind Bhardwaj
-
Velosophist
-
Valerii Tarasov
-
Kudzanayi Mutamba
-
Jon Godden
-
YJawhar
-
igorsantos07
-
Carlos Fajardo
-
Dave Doesntmatter
-
Benny Daon
-
Andrei
-
rsister
-
PC Electronics
-
albarin
-
Jorge
-
spobin
-
Cam
-
AWC
-
panchodev
-
Oleg Sorokin
-
Mohamad Atie
-
Myles
-
-
Erwin Van de Glind
-
Anonymous
-
SteveH
-
tyleha
-
cv
-
Polydash
-
Anoop Kulkarni
-
hjc1710
-
Herbert Bothetele
-
personface