AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1273024
Accepted
user1069309
user1069309
Asked: 2020-09-07 01:52:46 +0800 CST2020-09-07 01:52:46 +0800 CST 2020-09-07 01:52:46 +0800 CST

docker.io : 取决于: containerd (>= 1.2.6-0ubuntu1~)

  • 772

我在 Ubuntu 20.04 中安装 docker 时遇到问题。

wolf@linux:~$ sudo apt install docker.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~)
E: Unable to correct problems, you have held broken packages.
wolf@linux:~$ 

错误信息说我需要containerd (>= 1.2.6-0ubuntu1~)

这很奇怪,因为我已经有了更新的版本1.2.13-2

wolf@linux:~$ dpkg -l containerd.io 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-======================================
ii  containerd.io  1.2.13-2     amd64        An open and reliable container runtime
wolf@linux:~$ 

系统已更新。我已经执行sudo apt update && sudo apt upgrade并且不需要新的更新。

根据评论中的要求更新

wolf@linux:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal
wolf@linux:~$ 
container docker 20.04
  • 2 2 个回答
  • 28295 Views

2 个回答

  • Voted
  1. Best Answer
    Sabrina
    2020-09-07T02:27:18+08:002020-09-07T02:27:18+08:00

    containerd并且containerd.io是2个不同的包。

    尝试一下dpkg -l containerd*,您应该会看到这两个包。

    $ dpkg -l containerd*
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version        Architecture Description
    +++-==============-==============-============-======================================
    ii  containerd     1.3.3-0ubuntu2 amd64        daemon to control runC
    rc  containerd.io  1.2.13-2       amd64        An open and reliable container runtime
    $ 
    

    如果containerd不存在,请继续使用sudo apt install containerd.

    让我知道这是否有帮助。

    • 25
  2. Daniel Alder
    2021-06-15T17:10:38+08:002021-06-15T17:10:38+08:00

    我有同样的错误,但情况更复杂:

    ~# dpkg -l | grep containerd
    ii  containerd                            1.3.3-0ubuntu2.3                  amd64        daemon to control runC
    
    ~# apt-get install docker.io                 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    

    显然,我在更新时忽略了一个明确的警告:

    ~# apt-get dist-upgrade
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
      bridge-utils cgroupfs-mount dns-root-data dnsmasq-base git git-man iptables libcurl3-gnutls liberror-perl libip6tc2 libnetfilter-conntrack3 libnfnetlink0 libnftnl11 libnghttp2-14 librtmp1 libssh-4 patch pigz ubuntu-fan
    Use 'apt autoremove' to remove them.
    The following packages will be REMOVED:
      docker.io                    ^^^^^^^  !!!
    The following packages will be upgraded:
      containerd
    1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    Need to get 27.8 MB of archives.
    After this operation, 192 MB disk space will be freed.
    Do you want to continue? [Y/n] 
    

    我没有深入挖掘,但是有一些关于安全性的更新包,它们不适合。但它没有解释为什么docker.io不接受安装containerd的版本1.3.3-0ubuntu2.3,实际上是>= 1.2.6-0ubuntu1~

    ~# apt-cache policy docker.io containerd
    docker.io:
      Installed: (none)
      Candidate: 19.03.8-0ubuntu1.20.04.1
      Version table:
         19.03.8-0ubuntu1.20.04.1 500
            500 http://ch.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages
            100 /var/lib/dpkg/status
         19.03.8-0ubuntu1 500
            500 http://ch.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
    
    containerd:
      Installed: 1.3.3-0ubuntu2.3
      Candidate: 1.3.3-0ubuntu2.3
      Version table:
     *** 1.3.3-0ubuntu2.3 500
            500 http://ch.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
            100 /var/lib/dpkg/status
         1.3.3-0ubuntu2 500
            500 http://ch.archive.ubuntu.com/ubuntu focal/main amd64 Packages
    

    解决方法

    我可以通过降级containerd到主池包然后重新安装来解决这个问题docker.io:

    ~# apt-get install containerd=1.3.3-0ubuntu2
    The following packages will be DOWNGRADED:
      containerd
    ~# apt-get install docker.io
    

    错误报告

    此处的错误报告:https ://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1940920

    • 3

相关问题

  • 如何升级 Docker

  • debootstrap 或 virt-install Ubuntu Server Maverick 失败

  • 如何在本地机器上充分使用我通过 debootstrap 创建的 chroot?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve