首页 > 解决方案 > 在 Debian 10 上更新 docker

问题描述

我尝试使用以下命令更新 Debian 上的 docker:

sudo apt-get update --allow-releaseinfo-change

但我收到以下错误消息:

Hit:1 http://asi-fs-n.contabo.net/debian buster InRelease
Hit:2 http://asi-fs-n.contabo.net/debian buster-updates InRelease
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Get:4 https://download.docker.com/linux/debian buster InRelease [54.0 kB]
Hit:5 https://download.docker.com/linux/ubuntu zesty InRelease
Ign:6 https://download.docker.com/linux/ubuntu docker InRelease
Err:7 https://download.docker.com/linux/ubuntu docker Release
  404  Not Found [IP: 13.224.94.87 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu docker 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.

从另一个 StackOverflow 主题来看,我似乎必须更新文件 /etc/apt/sources.list.d/docker.list

我尝试了以下方法(但它不起作用):

deb https://get.docker.io/ubuntu docker main

注意到那个:

我应该更改为类似的东西,而不破坏/破坏我的操作系统吗?

deb https://download.docker.com/linux/debian docker buster

标签: dockerubuntudebianapt

解决方案


请参阅在 Debian 上安装 Docker 引擎。使用以下命令:

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

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

第一个命令将下载 gpg 密钥,第二个命令将调整您的 docker.list 文件。

然后运行sudo apt update


推荐阅读