【问题标题】:apt-get fails in Debian and Ubuntu based docker imagesapt-get 在基于 Debian 和 Ubuntu 的 docker 镜像中失败
【发布时间】:2016-01-19 08:23:45
【问题描述】:

尝试在 Debian 或 Ubuntu docker 映像中运行 apt-get update 时出现这个奇怪的错误:

root@60931d7602e1:/# apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign http://httpredir.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://httpredir.debian.org jessie-updates InRelease
Ign http://security.debian.org jessie/updates Release
Ign http://httpredir.debian.org jessie Release.gpg
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.debian.org jessie-updates Release.gpg
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.debian.org jessie Release
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://httpredir.debian.org jessie-updates Release
Err http://security.debian.org jessie/updates/main amd64 Packages

Err http://security.debian.org jessie/updates/main amd64 Packages
  404  NOT FOUND [IP: 149.20.20.6 80]
Err http://httpredir.debian.org jessie/main amd64 Packages
  404  NOT FOUND [IP: 176.9.184.93 80]
Err http://httpredir.debian.org jessie-updates/main amd64 Packages
  404  NOT FOUND [IP: 176.9.184.93 80]
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages  404  NOT FOUND [IP: 149.20.20.6 80]

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie/main/binary-amd64/Packages  404  NOT FOUND [IP: 176.9.184.93 80]

W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  NOT FOUND [IP: 176.9.184.93 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

我检查了 URL 不存在,应该是 .gz 或 .bz2 。它只发生在一台主机服务器上(运行 Ubuntu),目前在 boot2docker 和 Debian 中运行良好。

【问题讨论】:

    标签: docker debian http-status-code-404 apt-get


    【解决方案1】:

    由于您的实例的网络问题,您收到Failed to fetch 错误。最有可能的是缓存代理或坏镜像。解决这个问题的最简单方法是使用 VPN 连接从其他地理位置获取包更新,这将触发不同的镜像。

    【讨论】:

      【解决方案2】:

      我发现这是由于我们在服务器上设置的 IP 表规则将端口 80 重定向到 localhost 端口 5000。它是双向设置的。

      apt-get 正在请求不带 .gz / .bz2 的 URL,因为它已经失败了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-06-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-14
        • 2020-09-01
        • 1970-01-01
        相关资源
        最近更新 更多