【问题标题】:Update docker on Debian 10在 Debian 10 上更新 docker
【发布时间】:2021-09-07 17:29:40
【问题描述】:

我尝试使用以下命令在 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

【问题讨论】:

  • 源网址不对。我不知道具体是怎么回事。
  • @peterh 确实,但我最后一个 url (download.docker.com) 似乎是正确的。我只是不知道我必须放什么。 Zesty 或 buster,我真的不明白这是什么意思……我不想破坏我的操作系统。看到了吗?
  • Docker 是用 go 编写的,因此它非常独立于发行版。甚至可能甚至一个 redhat docker 也可以在 debian 发行版上运行。此外,所有的 linux 发行版都足够聪明:如果你安装了你不应该安装的东西,然后卸载它,99.999999% 什么都不会发生。这是我的 debian 靶心的 sources.list URL:deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable

标签: docker ubuntu debian apt


【解决方案1】:

Install Docker Engine on Debian。使用以下命令:

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

【讨论】:

    【解决方案2】:

    创建以下文件:

    $ cat /etc/apt/sources.list.d/docker-ce.list 
    deb [arch=amd64] https://download.docker.com/linux/debian buster stable
    

    然后删除/etc/apt/sources.list/etc/apt/sources.list.d/* 中的任何其他download.docker.com 条目

    【讨论】:

      【解决方案3】:

      我曾经在虚拟机上遇到过类似的问题。 “https://download.docker.com/linux/ubuntu docker”的存储库不存在,需要删除。不确定它为什么会在那里。

      这对我有用:

      1. 打开源列表(如果没有外部源列表):

        sudo nano /etc/apt/sources.list

      2. 像在 Debian 10 上一样删除“ubuntu”的所有行并保存

      3. 运行sudo apt-get update

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-04-04
        • 2021-12-19
        • 1970-01-01
        • 1970-01-01
        • 2021-11-08
        • 1970-01-01
        • 2021-01-26
        • 1970-01-01
        相关资源
        最近更新 更多