【问题标题】:Docker installation problem (ubuntu 20.04 LTS) - E: The repository 'https://download.docker.com/linux/ubuntu \ Release' does not have a Release fileDocker 安装问题 (ubuntu 20.04 LTS) - E: 存储库 'https://download.docker.com/linux/ubuntu\Release' 没有 Release 文件
【发布时间】:2022-03-10 02:03:06
【问题描述】:

我在虚拟机上安装 docker 时遇到问题。 我已按照以下步骤操作:

1.旧版本的 Docker 被称为 docker、docker.io 或 docker-engine。如果安装了这些,请卸载 他们:

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

2。更新 apt 包索引

sudo apt-get update

3.安装软件包以允许 apt 通过 HTTPS 使用存储库:

   sudo apt-get install \
   apt-transport-https \
   ca-certificates \
   curl \
   gnupg \
   lsb-release

4.添加 Docker 的官方 GPG 密钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

5.使用以下命令设置稳定存储库:

   echo \
     "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
   https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >
   /dev/null

6.更新 apt 包索引

sudo apt-get update

此时 - 在输入 sudo apt-get update 后 - 我收到以下错误

root@xxx:/home/xxx# sudo apt-get update
Hit:1 http://us-central1.gce.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease                                    
Hit:3 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease                                  
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                  
Ign:5 https://download.docker.com/linux/ubuntu \ InRelease                                              
Err:6 https://download.docker.com/linux/ubuntu \ Release
  404  Not Found [IP: 13.249.137.69 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu \ 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.

/etc/apt/sources.list.d/docker.list的内容

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

有办法解决吗?

【问题讨论】:

  • 您的/etc/apt/sources.list.d/docker.list的内容?
  • deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docker.com/linux/ubuntu\focal stable
  • 好吧,这就是你的问题
  • 我应该将focal stable 改为:deb [arch = amd64] https://download.docker.com/linux/ubuntu eoan stable 有意义吗?
  • 无论如何,我说deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable

标签: linux docker ubuntu apt-get


【解决方案1】:

确保/etc/apt/sources.list.d/docker.list 的内容与documentation 中的命令输出相对应,项目符号#3。

在撰写本文时,在我的 Ubuntu 20.04 LTS 上执行命令会导致 docker.list 文件的以下内容:

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

好像和你的不一样。

【讨论】:

  • 这对我有用。当我使用 Mint 20.1 时,我有 ulyssa stable,并更改为 focal stable 解决了这个问题。您可能被低估了,因为这在文档的第 3 条中有所说明,但我在那里错过了它并在这里找到了它,所以谢谢!
  • 感谢您的回答。链接中的第 3 点帮助了我
猜你喜欢
  • 1970-01-01
  • 2020-08-07
  • 1970-01-01
  • 2019-07-20
  • 2020-10-04
  • 2019-07-12
  • 2021-06-22
  • 1970-01-01
  • 2018-04-18
相关资源
最近更新 更多