security.debian.org 的 Debian Docker 镜像“没有发布文件”

vpe*_*son 23 debian docker

它显示为两者debian:stable-slim目前debian:stable都已损坏(用于更新):

> $ docker run -ti --rm  debian:stable-slim
Unable to find image 'debian:stable-slim' locally
stable-slim: Pulling from library/debian
fc491617b0f1: Pull complete
Digest: sha256:a85c2c0e634946e92a6f4a9a4f6ce5f19ce7c11885bc198f04ab3ae8dacbaffa
Status: Downloaded newer image for debian:stable-slim
root@e610973ac2f8:/# apt update
Ign:1 http://security.debian.org/debian-security stable/updates InRelease
Err:2 http://security.debian.org/debian-security stable/updates Release
  404  Not Found [IP: 151.101.130.132 80]
Get:3 http://deb.debian.org/debian stable InRelease [113 kB]
Get:4 http://deb.debian.org/debian stable-updates InRelease [36.8 kB]
Get:5 http://deb.debian.org/debian stable/main amd64 Packages [8178 kB]
Reading package lists... Done
E: The repository 'http://security.debian.org/debian-security stable/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Run Code Online (Sandbox Code Playgroud)

其他人经历过这个或找到了解决方法吗?

Ger*_*der 26

我可以通过更改此行来解决此问题:

deb http://security.debian.org/debian-security stable/updates main
Run Code Online (Sandbox Code Playgroud)

deb http://security.debian.org/debian-security stable-security/updates main
Run Code Online (Sandbox Code Playgroud)

您可以通过运行以下命令来做到这一点:

sed -i 's/stable\/updates/stable-security\/updates/' /etc/apt/sources.list
Run Code Online (Sandbox Code Playgroud)

  • Debian 11 的安全更新存储库已重命名。请参阅灰色框:https://debian-handbook.info/browse/en-US/stable/apt.html#sect.apt-sources.list.testing (5认同)

ala*_*ita 13

问题

在 Debian Stretch (9) Docker 映像上遇到此问题。

运行 apt-get update 时出现以下错误

W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  404  Not Found [IP: xx]
E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)

背景

这尤其与安全存储库有关。

这些 repo 定义由 apt 使用来获取更新,它们定义在/etc/apt/sources.list

官方 Debian 安全建议 - https://www.debian.org/security/

To keep your Debian operating system up-to-date with security patches, please add the following line to your /etc/apt/sources.list file

`deb http://security.debian.org/debian-security bullseye-security main contrib non-free`
Run Code Online (Sandbox Code Playgroud)

回答

在 Dockerfile 中添加这一行

RUN echo "deb http://security.debian.org/debian-security bullseye-security main contrib non-free" > /etc/apt/sources.list

RUN apt-get update
Run Code Online (Sandbox Code Playgroud)

其他解决方案

什么对我不起作用:

  • 将存储库更改为稳定安全
  • 使用标志运行 apt --allow-releaseinfo-change- 与 apt-get update 配对的标志无法识别

还有什么有效:

  • 您可以使用拉伸存档存储库,而不是使用 Bullseye 安全存储库deb http://archive.debian.org/debian stretch main contrib non-free;从安全角度来看,最好坚持最新版本的安全性

更新

如果您只是关注安全存储库问题,则上述内容是正确的。

为什么我们的安全存储库会出现这些问题?

就我而言,Debian 9 是一个存档的、不受支持、无人维护的版本。

虽然我可以“修复”(绕过)安全存储库,但我对 APT 的依赖存储库还有更多问题。由于该版本已弃用,这些存储库需要指向存档。

一般来说,这迫使我升级到 Debian 10。在 Debian 10 上,我不需要上述修复。