Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apt-get update fails with 404 in a previously working build

I am running a Travis build and it fails when building the mysql:5.7.27 docker image. The Dockerfile runs apt-get update and then I get an error W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages 404 Not Found.

Using curl I can see it is redirecting, but the redirect-to URL results in a 404. Has anyone seen this sort of behaviour and have a remedy? Is it basically unfixable until debian makes changes?

➜  ms git:(develop) curl --head http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 302 Found
Date: Tue, 26 Mar 2019 16:03:04 GMT
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Location: http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
Content-Type: text/html; charset=iso-8859-1

➜  ms git:(develop) curl --head http://cdn-fastly.deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages
HTTP/1.1 404 Not Found
Server: Apache
X-Content-Type-Options: nosniff
X-Frame-Options: sameorigin
Referrer-Policy: no-referrer
X-Xss-Protection: 1
Content-Type: text/html; charset=iso-8859-1
Via: 1.1 varnish
Content-Length: 316
Accept-Ranges: bytes
Date: Tue, 26 Mar 2019 16:03:17 GMT
Via: 1.1 varnish
Age: 45
Connection: keep-alive
X-Served-By: cache-ams21028-AMS, cache-cdg20741-CDG
X-Cache: HIT, HIT
X-Cache-Hits: 6, 2
X-Timer: S1553616198.734091,VS0,VE0
like image 703
mort Avatar asked Mar 26 '19 16:03

mort


People also ask

How do I fix my apt-get not working?

After installing the APT package, check the /usr/bin/ directory to ensure if it had properly installed. If the file is empty, then run the locate apt-get command again. If no result is shown, there is no alternative but to reinstall the operating system. This might fix the problem.

How do I fix 404 not found Ubuntu?

Here is a quick way to fix " 404 Not Found " errors on old Ubuntu by switching to old-releases repositories. First, replace main / security repositories with old-releases versions as follows. Then open /etc/apt/sources. list with a text editor, and look for extras.ubuntu.com .

How do I fix Apt update error in Ubuntu?

1) In the first step open the Terminal & type, apt-get update and then press the enter button. Now make sure you got a similar error as shown in the picture below. 2) Now open the app drawer & search “Software & Update”, now open the app from the search result. 3) Now go to the Ubuntu Software section.

How do I get sudo apt-get update?

How to Use the sudo apt-get upgrade Command. After running the sudo apt-get update command, in the same terminal window, type in sudo apt-get upgrade , enter your password if necessary, and hit enter.


1 Answers

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.

(As you can read here)

A solution (according to https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579) is to add this line:

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

into your Dockerfile before calling any apt-get update when using debian:jessie. This will remove the jessie-updates repository (which now causes the 404) from sources.list.

So while the following doesn't work:

FROM debian:jessie
RUN apt-get update
CMD /bin/sh

It works like:

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh
like image 88
codinghaus Avatar answered Sep 20 '22 15:09

codinghaus