【发布时间】: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