Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Error. Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages

Build Errors unable to find jq.

Err http://deb.debian.org jessie/main amd64 Packages 404 Not Found Err http://deb.debian.org jessie-updates/main amd64 Packages 404 Not Found Fetched 723 kB in 2s (357 kB/s) W: Failed to fetch http://deb.debian.org/debian/dists/jessie/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

E: Some index files failed to download. They have been ignored, or old ones used instead.
$ apt-get install jq
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package jq
ERROR: Job failed: exit code 1

like image 997
Mitesh Mehta Avatar asked Oct 23 '18 00:10

Mitesh Mehta


2 Answers

@codinghaus mentioned in another thread:

This is due to the fact that as Wheezy and Jessie have been integrated into the archive.debian.org structure recently, we are now removing all of Wheezy and all non-LTS architectures of Jessie from the mirror network starting today.

A solution (according to https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579) is to add the following command into your Dockerfile before calling any apt-get update when using debian:jessie.

RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived

This will remove the jessie-updates repository (which now causes the 404) from sources.list.

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh
like image 100
Fábio Viriato Avatar answered Sep 29 '22 23:09

Fábio Viriato


Just place this line before your apt-get commands in your Dockerfile:

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

Debian removed some url for old packages which is causing this issue. The line fixes the repository to refer to.

like image 42
Izumi.H Avatar answered Sep 29 '22 23:09

Izumi.H