Debian 9 映像上的 apt update 400 错误

Debian 9 映像上的 apt update 400 错误

我正在处理从以下位置提取的 debian:9 图像码头工人中心。当我运行apt update或 时apt-get update,我收到以下错误消息:

Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease          
Err:3 http://security.debian.org/debian-security stretch/updates Release      
 400  Bad request: request method denied
Ign:4 http://deb.debian.org/debian stretch-updates InRelease                  
Err:5 http://deb.debian.org/debian stretch Release
 400  Bad request: request method denied
Err:6 http://deb.debian.org/debian stretch-updates Release    
 400  Bad request: request method denied
Reading package lists... Done                                  
E: The repository 'http://security.debian.org/debian-security stretch/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.
E: The repository 'http://deb.debian.org/debian stretch 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.
E: The repository 'http://deb.debian.org/debian stretch-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.

我的sources.list文件看起来像这样(官方示例来自Debian 维基):

deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main

deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main

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

我也尝试过其他版本,但遇到了同样的错误。有谁知道可能导致问题的原因吗?非常感谢!

编辑:

谢谢优雅重启,我之前通过在Dockerfile中手动设置Debian镜像的网络代理最终解决了这个问题apt update

虽然问题被标记为重复,但与Debian:存储库没有发布文件,因为这是 400 错误,而sources.list文件实际上是正确的。

答案1

在此输入图像描述

Debian 9 源码.list Debian 测试的sources.list 与Debian 9(代号Stretch)不兼容

下面是一个 source.list 示例:

deb http://ftp.us.debian.org/debian/ 拉伸主要贡献非免费
deb http://ftp.us.debian.org/debian/stretch-updates 主要贡献非免费
deb http://security.debian.org/debian-security/stretch/updates 主要贡献非免费

以下sources.list尝试使用重定向来提供靠近您的位置的内容:

deb http://deb.debian.org/debian/ 拉伸主要贡献非免费
deb http://deb.debian.org/debian/stretch-updates 主要贡献非免费
deb http://deb.debian.org/debian-security/stretch/updates 主要贡献非免费

要更新您的系统,请照常进行:

apt-get update # 从源更新包信息
apt-get update # 升级包
apt-get dist-upgrade # 升级依赖于新依赖项的包

我确实建议在预生产环境中进行测试后,手动进行安全更新,或者将其作为计划升级的一部分通过其他配置系统进行。或者,您也可以安装无人值守升级包。

相关内容