apt-get 更新在以前的工作版本中失败并显示 404 [英] apt-get update fails with 404 in a previously working build

查看:24
本文介绍了apt-get 更新在以前的工作版本中失败并显示 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Travis 构建,但在构建 mysql:5.7.27 docker 映像时失败.Dockerfile 运行 apt-get update 然后我得到一个错误 W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/包 404 未找到.

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.

使用 curl 我可以看到它正在重定向,但重定向到 URL 会导致 404.有没有人看到这种行为并有补救措施?在 debian 进行更改之前,它基本上无法修复吗?

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

推荐答案

这是因为

因为 Wheezy 和 Jessie 已经被整合到了 archive.debian.org最近的结构,我们现在正在删除所有 Wheezy 和所有非 LTS从今天开始,镜像网络中 Jessie 的架构.

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.

(您可以在此处阅读)

一个解决方案(根据https://github.com/debuerreotype/docker-debian-artifacts/issues/66#issuecomment-476616579) 是添加这一行:

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

使用 debian:jessie 时,在调用 any apt-get update 之前

进入您的 Dockerfile.这将从sources.list 中删除jessie-updates 存储库(现在会导致404).

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

它的工作原理是:

FROM debian:jessie
RUN sed -i '/jessie-updates/d' /etc/apt/sources.list  # Now archived
RUN apt-get update
CMD /bin/sh

这篇关于apt-get 更新在以前的工作版本中失败并显示 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆