Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu 16.04 latest update broke Docker (docker-ce) [closed]

I run Ubuntu 16.04 on my desktop. I use docker-ce and it has been working up until a few days ago. The auto-update in Ubuntu seems to have broken it.

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

I tried following the instructions at https://docs.docker.com/install/linux/docker-ce/ubuntu/ to remove and reinstall but it hasn't worked.

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).

I believe the issue is with containerd.io. The command sudo apt-get -f install tries to install it and this errors:

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)

There was some problem with /usr/sbin/runc, as part of debugging I tried deleting the file there, but this has made no difference at all:

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

Does anyone have any suggestions as to what I should do next to investigate this issue.

like image 570
Robert3452 Avatar asked Nov 11 '18 20:11

Robert3452


1 Answers

I'd remove the runc package. The docker1.13.1 version is a pointer to a very old and unsupported version of docker, so this is likely left over from a past upgrade. Then you should be able to install containerd.io.

You may have to remove the docker-ce package first using apt-get remove docker-ce and then execute your apt-get remove runc then to install docker-ce again you have to use apt-get install docker-ce. This is because trying to remove runc without first removing docker-ce does not work

Let me know if that's successful as I'd like to open an issue in docker for this if one doesn't already exist.

like image 173
BMitch Avatar answered Oct 05 '22 01:10

BMitch