我无法安装Docker,因为containerd.io没有安装候选对象


33

我试图在Kubuntu 19.10上安装Docker。

我使用以下步骤进行安装:https : //docs.docker.com/install/linux/docker-ce/ubuntu/

在步骤2期间,添加存储库和密钥后,我收到此消息

Package containerd.io is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'containerd.io' has no installation candidate

Answers:


39

我猜这不是最干净的方法,但是我遇到了同样的问题,而您和我都改变了:

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   bionic \
   stable"

因为

$(lsb_release -cs)

返回“ eoan”(最新的ubuntu版本的名称,当前为19.10),这似乎会引起问题。用“ bionic”(ubuntu 18.10)代替它对我来说是完美的,但是四个月后我仍然没有问题。

不要忘记打开“ /etc/apt/sources.list”并注释掉/删除该行:

deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable

避免冲突。(您将此添加为在此过程中输入的第一个命令。)


是的,这似乎是一个错误。为了自动更新,必须对其进行修复
Nilanjan Sarkar

7

编辑文件:/etc/apt/sources.list

寻找回购条目:

deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable

更改为:

deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable 

为我解决了这个问题


0

官方Docker文档建议使用

  $ sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"

适用于Ubuntu 19.10,它似乎还不包含'containerd.io'软件包。

使用add-apt-repository --remove以下命令删除先前添加的存储库:

$ sudo add-apt-repository --remove \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"

并添加用于仿生(18.10)Ubuntu版本的版本:

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   bionic \
   stable"

之后,更新并安装docker:

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.