使用 docker 获取 http://deb.debian.org/debian/dists/jessie-updates/InRelease 的问题

Paj*_*ala 81 debian docker

我正在尝试运行命令 docker-compose build

我得到这个输出:

Step 4/8 : RUN apt-get update && apt-get install -y google-chrome-stable
 ---> Running in ee9551cd38b9
Ign http://dl.google.com stable InRelease

Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]

.....

Get:9 http://deb.debian.org jessie/main amd64 Packages [9098 kB]

W: Fetched 10.1 MB in 6s (1519 kB/s)
Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'webpack' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y google-chrome-stable' returned a non-zero code: 100
Run Code Online (Sandbox Code Playgroud)

任何有想法的人?

小智 135

我今天早上也遇到了这个问题。我能够通过结合以下两张票的建议来解决它:

如何解决 AWS apg-get 中针对 debian jessie fetch 的 404 错误?

/sf/ask/3248479321/

解决方案:

在您的Dockerfile, 在运行任何apt命令之前,添加以下行:

RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

这使得能够apt从新源运行。

debian:jesseDocker 映像可能会在不久的将来更新以正常工作,但在此之前,这将允许您继续工作

  • 谢谢!今天刚遇到同样的问题。这在我的情况下似乎有效。 (3认同)

xve*_*ges 21

debian 团队已修复它。再次拉动图像以便更新为我修复它:

docker pull debian:jessie
Run Code Online (Sandbox Code Playgroud)

来自链接票证的警告:

另外,请尽快离开 Jessie——时间在流逝!!


F. *_*uri 6

我的解决方案

快速解决方法

覆盖sources.list不是我想要的:

sed '/jessie-updates/s/^/# /' -i /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

只会评论包含jessie-updates并保留其他所有内容的行!

deb http://ftp.ch.debian.org/debian/ jessie main contrib
deb-src http://ftp.ch.debian.org/debian/ jessie main contrib

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

# # jessie-updates, previously known as 'volatile'
# deb http://ftp.ch.debian.org/debian/ jessie-updates main contrib
# deb-src http://ftp.ch.debian.org/debian/ jessie-updates main contrib
Run Code Online (Sandbox Code Playgroud)

所以我在Debian jessie保持支持的同时继续使用本地镜像。

升级到拉伸

然后为了升级到拉伸,我只是

sed 's/jessie/stretch/' -i.jessie /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

这将创建一个 source.list.jessie

然后我可以取消注释stretch-updates行:

sed '/stretch-updates/s/^# //' -i /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)