【问题标题】:Why do I see Failed to fetch error while dping apt-get update为什么我在 dping apt-get update 时看到 Failed to fetch 错误
【发布时间】:2020-07-19 07:46:42
【问题描述】:

我的 jenkins 作业中的 apt-get update 在拉取 docker hub 相关存储库时因 Http404 错误而失败

12:38:54 + uname -a
12:38:54 Linux c612ce175fe3 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
12:28:18 W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-amd64/Packages  HttpError404
12:28:18 
12:28:18 W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-i386/Packages  HttpError404
12:28:18 

【问题讨论】:

    标签: docker apt http-error


    【解决方案1】:

    我在几个较旧的 Ubuntu 测试系统上遇到了同样的问题。在搜索404错误https://apt.dockerproject.org/的URL时终于找到了这个提示

    注意:关闭 dockerproject.org APT 和 YUM repos 2020-03-31

    Docker 将于 2020 年 3 月 31 日关闭托管在“dockerproject.org”和“dockerproject.com”的已弃用的 APT 和 YUM 存储库。

    我们注意到该项目正在引用其中一个存储库,并建议更新以使用“download.docker.com”存储库以防止中断。

    更多信息:https://www.docker.com/blog/changes-dockerproject-org-apt-yum-repositories/

    我的解决方法是编辑 /etc/apt/sources.list.d/docker.list 或 /etc/apt/sources.list 并注释掉旧行并添加新行。对于我的树莓派,我使用 [arch=armhf] 而不是 [arch=amd64],希望这会有所帮助。

    sudo vi /etc/apt/sources.list.d/docker.list
    

    进行此更改

    #       deb https://apt.dockerproject.org/repo ubuntu-trusty main
    deb [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable
    

    【讨论】:

    • 这修复了Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-trusty/main/binary-amd64/Packages Could not resolve host: apt.dockerproject.org 错误,对我来说(对于sudo apt-get update)。谢谢。我确实需要运行 y-ppa-manager 来解决一个后续问题。
    • 在使用curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - docs.docker.com/engine/install/ubuntu/… 更新源列表后,我还必须重新添加 GPG 密钥
    【解决方案2】:

    我遇到了同样的问题。 但我在docker.list 文件中做了以下更改。

    sudo nano /etc/apt/sources.list.d/docker.list
    

    并进行了以下更改。

    # deb https://apt.dockerproject.org/repo ubuntu-trusty main
    

    然后,

    sudo apt-get update
    

    它确实对我有用。 谢谢。

    【讨论】:

      猜你喜欢
      • 2020-09-18
      • 2023-01-27
      • 2020-11-25
      • 1970-01-01
      • 2023-02-15
      • 2017-10-14
      • 1970-01-01
      • 2023-02-15
      • 2022-01-11
      相关资源
      最近更新 更多