Ubuntu 16.04最新更新破坏了Docker(docker-ce)

时间:2018-11-11 20:16:38

标签: linux docker ubuntu ubuntu-16.04

我在桌面上运行Ubuntu 16.04。我使用docker-ce,直到几天前它一直在工作。 Ubuntu中的自动更新似乎已将其破坏。

robert@catness:~$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

我尝试按照https://docs.docker.com/install/linux/docker-ce/ubuntu/上的说明进行删除和重新安装,但没有成功。

robert@catness:~$ sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
docker-ce is already the newest version (5:18.09.0~3-0~ubuntu-xenial).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 docker-ce : Depends: containerd.io but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我认为问题出在containerd.io。命令sudo apt-get -f install尝试安装它,并且出现以下错误:

The following additional packages will be installed:
  containerd.io
The following NEW packages will be installed
  containerd.io
0 to upgrade, 1 to newly install, 0 to remove and 1 not to upgrade.
1 not fully installed or removed.
Need to get 0 B/19.9 MB of archives.
After this operation, 87.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 523620 files and directories currently installed.)
Preparing to unpack .../containerd.io_1.2.0-1_amd64.deb ...
Unpacking containerd.io (1.2.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/containerd.io_1.2.0-1_amd64.deb (--unpack):
 trying to overwrite '/usr/sbin/runc', which is also in package runc 1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/containerd.io_1.2.0-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

/ usr / sbin / runc出现了一些问题,作为调试的一部分,我尝试删除该文件,但这完全没有区别:

robert@catness:~$ ls /usr/sbin/runc
ls: cannot access '/usr/sbin/runc': No such file or directory
robert@catness:~$ sudo ls /usr/sbin/runc
ls: cannot access '/usr/sbin/runc': No such file or directory

有人对我下一步要调查此问题有什么建议。

1 个答案:

答案 0 :(得分:29)

我将删除 runc 软件包。 docker1.13.1 版本是指向非常老旧且不受支持的Docker版本的指针,因此这很可能是以前的升级遗留下来的。然后,您应该能够安装 containerd.io

您可能必须先使用 apt-get remove docker-ce 删除docker-ce软件包,然后执行 apt-get remove runc ,然后再次安装docker-ce您必须使用 apt-get install docker-ce 。这是因为尝试在不先删除docker-ce的情况下删除runc不起作用

让我知道这是否成功,因为如果一个人不存在,我想为此在docker中打开一个问题。