security.debian.org 的 Debian Docker 映像“沒有發布檔案”

security.debian.org 的 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.

其他人經歷過這個或找到解決方法了嗎?

答案1

我可以透過更改此行來解決此問題:

deb http://security.debian.org/debian-security stable/updates main

deb http://security.debian.org/debian-security stable-security/updates main

您可以透過執行以下命令來做到這一點:

sed -i 's/stable\/updates/stable-security\/updates/' /etc/apt/sources.list

答案2

問題

在 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.

背景

這尤其與安全儲存庫有關。

這些 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`

回答

在 Dockerfile 中新增這一行

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

RUN apt-get update

其他解決方案

什麼對我不起作用:

  • 將儲存庫變更為穩定安全
  • 使用--allow-releaseinfo-change標誌運行 apt - 與 apt-get update 配對的標誌無法識別

還有什麼有效:

  • 您可以使用拉伸存檔儲存庫,而不是使用 Bullseye 安全儲存庫deb http://archive.debian.org/debian stretch main contrib non-free;從安全角度來看,最好堅持最新版本的安全性

更新

如果您只是關注安全存儲庫問題,則上述內容是正確的。

為什麼我們的安全儲存庫會出現這些問題?

就我而言,Debian 9 是一個存檔的、不受支援、無人維護的版本。

雖然我可以「修復」(繞過)安全儲存庫,但我對 APT 的依賴儲存庫還有更多問題。由於該版本已棄用,這些儲存庫需要指向存檔。

一般來說,這迫使我升級到 Debian 10。

答案3

來自 debian.org...(將“stretch”替換為您目前正在運行的版本)。刪除其他看起來相似的行,然後 apt-get update 和 apt-get Upgrade。

deb http://archive.debian.org/debian/ stretch main non-free contrib
deb-src http://archive.debian.org/debian/ stretch main non-free contrib

deb http://archive.debian.org/debian-security/ stretch/updates main non-free contrib
deb-src http://archive.debian.org/debian-security/ stretch/updates main non-free contrib

相關內容