Getting a "Failed to fetch Backports..." Error when upgrading from Debian 7.4 to latest
This article describes how to properly update from an early release of Debian 7 (wheezy) to the latest.
When trying to update Debian 7 to the latest minor release (7.9) using the command sudo apt-get update && apt-get upgrade, the update stops with the following errors:
W: Failed to fetch http://backports.debian.org/debian-backports/dists/wheezy-backports/main/binary-amd64/Packages 404 Not Found [IP: 220.127.116.11 80]
W: Failed to fetch http://backports.debian.org/debian-backports/dists/wheezy-backports/contrib/binary-amd64/Packages 404 Not Found [IP: 18.104.22.168 80]
W: Failed to fetch http://backports.debian.org/debian-backports/dists/wheezy-backports/non-free/binary-amd64/Packages 404 Not Found [IP: 22.214.171.124 80]
Why is this happening?
The issue is with the file that lists the sources from which Debian packages can be obtained: /etc/apt/sources.list
The Backport package for Debian Wheezy is now part of the main archive so your sources.list file must be updated. Open /etc/apt/sources.list in vim editor and you'll find the following source:
deb http://backports.debian.org/debian-backports wheezy-backports main contrib non-free
Comment this out and add the following source instead:
deb http://ftp.us.debian.org/debian/ wheezy-backports main contrib non-free
See the image below to see an example updated sources.list file. Once you've added the new source, save and rerun sudo apt-get update && apt-get upgrade. The update to Debian 7.9 should complete successfully!