How to fix "Failed to fetch Packages 404 Not Found"?

Depending on which Debian mirror you are using, the error message looks like this:

W: Failed to fetch http://ftp.debian.org/debian/dists/lenny/main/binary-i386/Packages 404 Not Found
W: Failed to fetch http://ftp.debian.org/debian/dists/lenny/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ftp.debian.org/debian/dists/etch/main/binary-i386/Packages 404 Not Found
W: Failed to fetch http://ftp.debian.org/debian/dists/etch/main/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.debian.org/debian/dists/lenny/main/source/Sources 404 Not Found E: Some index files failed to download, they have been ignored, or old ones used instead.

 

 

This usually happens when your installation is already a bit outdated and the proper way to fix this is to upgrade to the next release, but in an emergency you can still access the deb files from the offical mirrors, but the location has moved. So edit /etc/apt/source.list and change the path to this:

deb http://ftp.at.debian.org/debian-archive/debian/ lenny main
deb-src http://ftp.at.debian.org/debian-archive/debian/ lenny main

 

You cannot comment on this entry