Docker 安装问题 (ubuntu 20.04 LTS) - E: 存储库 'https://download.docker.com/linux/ubuntu\Release' 没有 Release 文件

tbo*_*one 5 linux ubuntu apt-get docker

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

\n

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

\n

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

\n

2.更新apt包索引

\n

sudo apt-get update

\n

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

\n
   sudo apt-get install \\\n   apt-transport-https \\\n   ca-certificates \\\n   curl \\\n   gnupg \\\n   lsb-release\n
Run Code Online (Sandbox Code Playgroud)\n

4.添加Docker\xe2\x80\x99s官方GPG密钥:

\n

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

\n

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

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

6.更新apt包索引

\n

sudo apt-get update

\n

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

\n
root@xxx:/home/xxx# sudo apt-get update\nHit:1 http://us-central1.gce.archive.ubuntu.com/ubuntu focal InRelease\nHit:2 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease                                    \nHit:3 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease                                  \nHit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                  \nIgn:5 https://download.docker.com/linux/ubuntu \\ InRelease                                              \nErr:6 https://download.docker.com/linux/ubuntu \\ Release\n  404  Not Found [IP: 13.249.137.69 443]\nReading package lists... Done\nE: The repository 'https://download.docker.com/linux/ubuntu \\ Release' does not have a Release file.\nN: Updating from such a repository can't be done securely, and is therefore disabled by default.\nN: See apt-secure(8) manpage for repository creation and user configuration details.\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n

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

\n

有办法解决吗?

\n

jab*_*son 14

确保内容与文档/etc/apt/sources.list.d/docker.list中命令的输出相对应,项目符号 #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

这似乎与你的不同。