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

标签 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

有没有人对我接下来应该做什么来调查这个问题有任何建议。

最佳答案

我会删除 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 中为此打开一个问题。

关于linux - Ubuntu 16.04 最新更新破坏了 Docker (docker-ce),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53252818/

相关文章:

linux - Linux内核代码的哪一部分负责实现LRU?

linux - 带有 --foundation 的 swift-corelibs-dev 构建脚本不起作用

python - 在终端本地运行 mapper.py 后出错

linux - 错误 : Cannot find module '.../node_modules/sqlite3/lib/binding/node-v14-linux-x64/node_sqlite3.node'

c - 在 C 程序上通过 execve/l 执行 omxplayer 不会在 fork() 之后在子进程的非 X 控制台上输出视频

linux - Bash Script_将从读取命令读取的变量插入命令

linux - 防止 Docker Compose 创建单独的网络

docker - 推送到端口转发的 docker 注册表

amazon-web-services - 如何从 Cloud Formation 获取 Elastic Container Repository URI?

android-studio - 如何在 Ubuntu 上为预览和稳定的 android studio 创建第二个桌面条目