Failed to fetch jessie backports repository

I’m using a docker image as a base for my own development that adds the jessie backports repository in its Dockerfile and uses that to install a dependency. This image uses the following command to add the repository:

echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list

The problem is that fetching packages from the backports repository now fails with the following error (this used to work previously):

W: Failed to fetch
http://ftp.debian.org/debian/dists/jessie-backports/main/binary-amd64/Packages
404  Not Found

W: Failed to fetch
http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
 404  Not Found

I looked on that server, and those paths are indeed not present there.

I tried to figure out on the Debian backports site whether this particular repository should still be available, and I didn’t find any indication that this was deprecated or something like that.

Is this a temporary issue with the repository, or is the jessie-backports repository not available anymore? And if this is not a temporary issue, what options do I have to use this or an equivalent repository without upgrading to the newer Debian stable version?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Wheezy and Jessie were recently removed from the mirror network, so if you want to continue fetching Jessie backports, you need to use archive.debian.org instead:

deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main

(Validity checks need to be disabled since the repository is no longer being updated. Jessie’s apt doesn’t support the check-valid-until flag, see inostia’s answer for details, and the configuration summary further down in this answer.)

The jessie-updates repository has been removed: all the updates have been merged with the main repository, and there will be no further non-security updates. So any references to jessie-updates in sources.list or sources.list.d files need to be removed. Security updates will continue to be provided, on LTS-supported architectures, in the security repository, until June 30, 2020.

Since you’re building a container image, I highly recommend basing it on Debian 9 (Stretch) instead. To stay on Debian 8 (Jessie), your repositories should end up looking like

deb http://cdn-fastly.deb.debian.org/debian/ jessie main
deb-src http://cdn-fastly.deb.debian.org/debian/ jessie main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

deb http://archive.debian.org/debian jessie-backports main
deb-src http://archive.debian.org/debian jessie-backports main

(without the jessie-updates repository).

You’ll also need to disable validity checks in /etc/apt/apt.conf (which will apply to all repositories):

Acquire::Check-Valid-Until "false";

Solution 2

After trying solutions suggested by @inostia and @Stephen Kitt I was still getting the following error:

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

I figured out that it can be solved by removing the line deb http://deb.debian.org/debian jessie-updates main from /etc/apt/sources.list.

I ended up with the following snippet in my Dockerfile:

RUN echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list
RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
RUN apt-get -o Acquire::Check-Valid-Until=false update

Solution 3

For those using NodeJS with older docker image foundations. I had some frozen images that had these older sources for the compilation of extra libs.

Context: if you wanted to install python during a docker build you ran into this issue during a build of the image (within the last 24 hours) as it failed to source dependencies during a docker build.

I tried the archive path recommendations in this post but couldn’t get past the 404’s. (also coming from the archive.debian.org location as of today)

Solution: I ended up switching to the latest container version of node (which has python libs already pre-installed) that, and updating some libs in the package json (which now also include binary libs that used to want pythyon) made the issue obsolete.

In the end, updating the foundation image for the container stack (node:latest) seemed to be the most straight-forward path to resolution.

Be wary of stale image stacks with binary dependencies included, they’ll probably take a while to update the core OS layer.

Solution 4

If nothing works anymore, with a panel of those errors:

Unable to correct missing packages.
WARNING: The following packages cannot be authenticated!
W: GPG error
W: An error occurred during the signature verification.
Updates for this repository will not be applied.
E: Failed to fetch
E: Aborting install 

Consider a full distribution upgrade and a source list clean up to save your machine. It will takes only minutes with those notes, but it’s worst it.

First visit /etc/apt/sources.list.d/, and remove everything. (Do backups).

Edit /etc/apt/sources.list, leave only this line:

deb http://ftp.us.debian.org/debian stable main contrib 

Then, as root, run:

aptitude update
aptitude full-upgrade

Confirm the various messages. Then try:

sudo apt update

Should raise no errors, just confirming:

Reading package lists... Done

Some various packages can raise some conflicts, on those cases, to be used one time, this will resolve the various conflicts:

sudo aptitude -y install packagename otherpackagename

Possible other error:

W: There is no public key available for the following key IDs:
*648ACFXXXXX2FAB138*

To solve, import the public keys as specified:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFXXXXX2FAB138

You might hit a very rare message!

A reboot is required to replace the running dbus-daemon.
Please reboot the system when convenient.

You might hit an issue with olds kernels and libc:

Kernel must be upgraded

This version of the GNU libc requires kernel version 3.2 or later.  Please upgrade your kernel 

Do not apply those notes for public servers. Always go for the last LTS.


https://www.debian.org/doc/manuals/debian-faq/ch-uptodate.en.html

https://askubuntu.com/questions/364404/e-unable-to-fetch-some-archives-maybe-run-apt-get-update-or-try-with-fix-mis

https://askubuntu.com/questions/766883/there-is-no-public-key-available-for-the-following-key-ids-1397bc53640db551

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply