【问题标题】:Docker Repository Does Not Have a Release File on Running apt-get update on UbuntuDocker 存储库在 Ubuntu 上运行 apt-get update 时没有发布文件
【发布时间】:2017-04-29 05:50:28
【问题描述】:

我正在使用 Ubuntu 16.10,并且最近按照找到的说明使用 Xenial 构建安装了 Docker (v1.12.4) here。我在创建容器、确保它们自动重启等方面没有遇到任何问题。

但是,现在每次我运行 apt-get update 我都会收到以下错误消息:

W: The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.

我已尝试按照here 的建议解决此问题,但似乎无法解决此问题。

有没有人遇到过这个问题并修复过?如果是这样,需要什么来解决这个问题?

【问题讨论】:

  • 请看看这是否有帮助 - askubuntu.com/questions/768569/…
  • @Rao,不幸的是,这并不能解决问题。删除密钥、源列表条目、再次运行 apt-get update,然后重复 Docker 安装步骤后,我仍然收到相同的错误消息。
  • @Rao,我想出了解决方案并添加了答案。但是,您提到的文章可能对其他偶然发现我的问题的人有益,因此 +1。干杯。
  • 在我的情况下,下面的答案没有帮助。我的问题是我使用的 apt-cacher-ng 没有代理 https 流量。 github.com/moby/moby/issues/22599#issuecomment-404675734

标签: ubuntu docker apt-get


【解决方案1】:

在 Linux Mint 上,官方说明对我不起作用。我必须进入 /etc/apt/sources.list.d/additional-repositories.list 并将 serena 更改为 xenial 以反映我的 Ubuntu 代号。根据您的 Debian 变体、版本和原始安装方法,您可能需要改为修改 /etc/apt/sources.list.d/docker.list

您通常可以通过运行几个不同的命令之一来找到合适的代号。在以下示例中,focal 是代号:

$ grep CODENAME /etc/os-release
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

$ lsb_release -c
Codename:   focal

# NOTE: On Ubuntu 20.04.2, /etc/os-release is symlinked to /usr/lib/os-release and
#       lsb_release reads from /usr/lib/os-release.

【讨论】:

  • 请注意,由于某种原因,我在该文件中有一条带有 trusty 的 docker 行和另一个带有 serena 的行。也许我前段时间尝试过同样的过程,却忘记了。无论如何,我不得不删除 trusty 行,否则它会抱怨无法解决的依赖关系。
  • 感谢目录 sources.list.d 参考。修复了 "sudo rm /etc/apt/sources.list.d/docker*" 的 Ubuntu xenial 问题。现在 apt-get update 终于可以使用了。
  • Debian 也一样:将文件“/etc/apt/sources.list.d/docker.list”中的“debian 10 stable”替换为“debian stretch stable”,它应该可以工作。跨度>
  • 我不得不把我的改成bionic
  • 这行得通,但我必须将m 添加到它不起作用的链接deb [arch=amd64] https://download.docker.co/linux/ubuntu bionic stable 注意docker.co 中缺少一个m,它应该是/docker.com/...
【解决方案2】:

对于Linux Mint,这个问题其实是在Docker website中引用的:

注意:下面的 lsb_release -cs 子命令返回您的名称 Ubuntu 发行版,例如xenial。有时,在像这样的分布中 Linux Mint,您可能需要将 $(lsb_release -cs) 更改为您的父母 Ubuntu 发行版。例如,如果您使用的是 Linux Mint Rafaela, 你可以使用可信赖的。

amd64:

$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

lsb_release -cs 命令提供了一个 Docker 没有准备好的包的存储库 - 您必须将其更改为 xenial。

Linux Mint 18 which is based on Ubuntu 16.04 Xenial 的正确命令是

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   xenial \
   stable"

【讨论】:

  • 您提供的命令与 docker 站点上存在的命令相同。但是它在 ubuntu 16.04 上对我不起作用。在sources.list 中生成的条目是:deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable 但还是同样的问题。我希望有人能解释为什么在https://download.docker.com/linux/ubuntu/dists/xenial/stable/binary-amd64/ 中找不到Release。悲伤:使用 ubuntu 这么多年后,我仍然无法弄清楚存储库路径是如何工作的。
  • 这解决了我在新的 WLinux 发行版上的问题。
【解决方案3】:

艾略特海滩是正确的。谢谢艾略特。

这是我gist的代码。

sudo apt-get remove docker docker-engine docker.io

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"

sudo apt-get update

sudo apt-get install docker-ce

sudo docker run hello-world

【讨论】:

  • 如果不运行 xenial,请小心运行这些命令。这个命令会更安全add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  • 在某些情况下(即 Mint)lsb_release -cs 返回 tara,它没有受支持的版本,因此如图所示(或可靠)特别覆盖 xenial 是一个有用的解决方法。
  • 正式名称为 Elliott Beach 的用户将被称为 Warlike Chimpanzee
  • 您的要点修复了 Kubuntu eoan 的“E:包 'containerd.io' 没有安装候选者”问题。有些人用仿生解决了它,但它对我不起作用,按照你的要点用xenial做了。当您使用 $(lsb_release -cs) 时会出现问题,因为它不完全受支持。其他人报告使用这种“错误配置”黑客 4 个月没有任何问题并且计数 (stackoverflow.com/questions/60274857/…)
【解决方案4】:

正如官方 docker 文档中所建议的那样。尝试运行:

  • sudo vi /etc/apt/sources.list

然后在文件的最后几行删除/注释任何 (deb [arch=amd64] https://download.docker.com/linux/ubuntu/ xenial stable) 此类条目。

然后在终端运行这个命令:

  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ bionic stable"

  • sudo apt-get update

它在我的情况下有效。

【讨论】:

    【解决方案5】:

    Linux Mint 20 Ulyana 用户需要在

    中将 "ulyana" 更改为 "bionic"

    /etc/apt/sources.list.d/additional-repositories.list

    像这样:

    deb [arch=amd64] https://download.docker.com/linux/ubuntu    bionic    stable
    

    【讨论】:

    • Linux Mint 20 Ulyana 构建在最新的 Ubuntu 20.04 LTS Focal Fossa 之上。使用焦点插入
    • @MarceloFonseca 我使用的是最新的 Linux Mint 版本。由于一些奇怪的原因,当我尝试使用焦点时,它一直告诉我它没有发布文件。仅当我在 /etc/debian_version 中检索 Debian 版本时它才有效。
    • 从 ulyana 更改为仿生工作。谢谢
    【解决方案6】:

    我在这里看到了来自 Ikraider 的一篇有趣的帖子,它解决了我的问题: https://github.com/docker/docker/issues/22599

    网站说明有误,以下是 16.04 中的内容:

    curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
    apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
    sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
    sudo apt-get update
    sudo apt-get install docker-engine=1.13.0-0~ubuntu-xenial
    

    【讨论】:

      【解决方案7】:

      我在 Linux mint 上遇到了类似的问题,我所做的发现是使用 Debian 版本,

      $ cat /etc/debian_version buster/sid

      然后在

      中替换了Debian版本
      $ sudo vi /etc/apt/sources.list.d/additional-repositories.list
      deb [arch=amd64] https://download.docker.com/linux/debian    buster    stable
      

      【讨论】:

      • 这是唯一对我有用的解决方案。我尝试了其他建议使用 Ubuntu“焦点”版本的建议,但我仍然遇到同样的错误。使用 debian_version (bullseye),它起作用了。
      【解决方案8】:

      我也有类似的问题。有人可能会发现对我有用的东西。

      机器正在运行 Ubuntu 16.04 并具有 Docker CE。在查看了此处提供的答案和链接之后,特别是来自 Elliot Beach 提供的 Docker 网站的链接,我打开了我的 /etc/apt/sources.list 并检查了它。

      该文件同时包含deb [arch=amd64] https://download.docker.com/linux/ubuntu (lsb_release -cs) stabledeb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

      由于需要第二个,我只是将第一个注释掉,保存了文档,现在问题已解决。作为测试,我回到同一个文档,删除了评论标志并再次运行sudo apt-get update。当我这样做时,问题又回来了。

      回顾一下:我不仅拥有 Docker 网站上所述的父级 Ubuntu 发行版名称,而且还注释掉了仍包含 (lsb_release -cs) 的行。

      【讨论】:

      【解决方案9】:

      编辑文件/etc/apt/sources.list.d/additional-repositories.list并添加deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable 为我工作,这篇文章很有帮助https://github.com/typora/typora-issues/issues/2065

      【讨论】:

        【解决方案10】:

        我仍然有同样的问题。上面的答案似乎都没有解决它。 我有 ubuntu 16.04,我按照https://docs.docker.com/install/linux/docker-ce/ubuntu/中描述的步骤进行操作

        我怀疑它与关于 https 的 apt-get 错误有关。 apt-get 打印的信息有点误导。

        我觉得Failed to fetch..也可以翻译成:problem accessing resource from within an https connection

        我是怎么得出这个结论的:

        首先我在公司代理后面,所以我设置了以下内容 配置:

        /etc/apt/apt.conf

        Acquire::http::proxy "http://squidproxy:8080/";
        Acquire::https::proxy "http://squidproxy:8080/";
        Acquire::ftp::proxy "ftp://squidproxy:8080/";
        
        Acquire::https::CaInfo     "/etc/ssl/certs/ca-certificates.pem";
        

        /etc/apt/apt.conf.d/99proxy

        Acquire::http::Proxy {
            localhost DIRECT;
            localhost:9020 DIRECT;
            localhost:9021 DIRECT;
        };
        

        我在sources.list 中使用不同的条目进行了以下测试

        测试条目 1:

        deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable

        sudo apt-get update

        W: The repository 'https://download.docker.com/linux/ubuntu xenial Release' does not have a Release file.
        N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
        N: See apt-secure(8) manpage for repository creation and user configuration     details.
        E: Failed to fetch     https://download.docker.com/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages  
        E: Some index files failed to download. They have been ignored, or old ones used instead.
        

        失败

        测试条目 2:

        deb [arch=amd64] http://localhost:9020/linux/ubuntu xenial stable

        /etc/apache2/sites-enabled/apt-proxy.conf

        # http to https reverse proxy configuration.
        Listen 9020
        <VirtualHost *:9020>
        SSLProxyEngine On
        # pass from squid proxy
        ProxyRemote https://download.docker.com/ http://squidproxy:8080
        ProxyPass / https://download.docker.com/
        ProxyPassReverse / https://download.docker.com/
        ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
        CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
        </VirtualHost>
        

        sudo apt-get update

        Hit:1 ..
        Hit:2 ..
          ...                                                              
        Hit:7 http://localhost:9020/linux/ubuntu xenial InRelease                
        Get:8 ...
        Fetched 323 kB in 0s (419 kB/s)
        Reading package lists... Done
        

        成功

        测试条目 3:

        deb [arch=amd64] https://localhost:9021/linux/ubuntu xenial stable

        /etc/apache2/sites-enabled/apt-proxy.conf

        # https to https revere proxy
        Listen 9021
        <VirtualHost *:9021>
        # serve on https
        SSLEngine on
        SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
        SSLProxyEngine On
        # pass from squid proxy
        ProxyRemote https://download.docker.com/ http://squidproxy:8080
        ProxyPass / https://download.docker.com/
        ProxyPassReverse / https://download.docker.com/
        ErrorLog ${APACHE_LOG_DIR}/apt-proxy-error.log
        CustomLog ${APACHE_LOG_DIR}/apt-proxy-access.log combined
        </VirtualHost>
        

        sudo apt-get update

        W: The repository 'https://localhost:9021/linux/ubuntu xenial Release' does not have a Release file.
        N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
        N: See apt-secure(8) manpage for repository creation and user configuration details.
        E: Failed to fetch https://localhost:9021/linux/ubuntu/dists/xenial/stable/binary-amd64/Packages  
        E: Some index files failed to download. They have been ignored, or old ones used instead.
        

        失败


        在上述情况下,apt-get Failed to fetch 以及 Release 文件的 url 实际上可以使用相同的代理配置从 browser / wget / curl 访问。
        apt-get 仅适用于 http 反向代理 url 这一事实意味着存在一些从 https 连接中访问资源的问题
        我不知道这个问题是什么,但apt-get 应该会显示更多信息(apt 更简洁)。

        注意:wiresharking case 1显示代理CONNECT成功,并没有发送RST,当然文件也无法读取。

        【讨论】:

          【解决方案11】:

          这就是在 LinuxMint 19 上对我有用的方法。

          curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
          apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
          sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
          sudo apt-get update
          sudo apt-get install docker-ce docker-ce-cli containerd.io
          
          

          【讨论】:

            【解决方案12】:

            在 Linux Mint 中 更改目录

            cd /etc/apt/sources.list.d
            ls -la
            

            找到一个文件调用 docker.list 并用 nano 文本编辑器编辑它

            sudo nano docker.list
            // or
            /etc/apt/sources.list.d/additional-repositories.list
            

            在我的情况下替换 Linux mint 版本是焦点 在你的情况下,它可能是仿生、焦点、破坏者等

            查看代号

            lsb_release -a
            
            deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable
            

            【讨论】:

              【解决方案13】:

              最好检查这个问题:(如果你在代理后面),(在 ubuntu 18.04 上测试),(也可以在其他 ubuntu 上工作),(主要是错误:https_proxy="http://192.168.0.251:808 /)

              1. 检查这些文件:

                #sudo cat /etc/environment :
                http_proxy="http://192.168.0.251:808/"
                https_proxy="http://192.168.0.251:808/"
                ftp_proxy="ftp://192.168.0.251:808/"
                socks_proxy="socks://192.168.0.251:808/"
                #sudo cat /etc/apt/apt.conf :
                Acquire::http::proxy "http://192.168.0.251:808/";
                Acquire::https::proxy "http://192.168.0.251:808/";
                Acquire::ftp::proxy "ftp://192.168.0.251:808/";
                Acquire::socks::proxy "socks://192.168.0.251:808/";
                
              2. 添加 docker 稳定库

                #sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 
                
              3. 运行 apt-get 更新:

                #sudo apt-get update
                
              4. 检查 Docker CE

                #apt-cache policy docker-ce
                
              5. 安装 Docker

                #sudo apt-get install docker-ce
                

              【讨论】:

                猜你喜欢
                • 2018-04-18
                • 2018-11-04
                • 1970-01-01
                • 2015-07-08
                • 1970-01-01
                • 2012-02-14
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                相关资源
                最近更新 更多