moby: Ubuntu packaging needs a conflict between containerd.io and old runc installs

Description

(This is relaying an issue reported on stackoverflow)

If an older install of runc remains on the docker host, the containerd.io package will fail to upgrade.

Steps to reproduce the issue:

Attempt to upgrade docker-ce to 18.09 on Ubuntu while an older runc package remains.

Describe the results you received:

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

Forcing the install of containerd.io results in:

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)

Note the older install of runc 1.0.0~rc2+docker1.13.1-0ubuntu1~16.04.1 in the above output.

Describe the results you expected:

The containerd.io package should force the removal of older runc packages to avoid the conflict.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Not available.

Output of docker info:

Not available.

Additional environment details (AWS, VirtualBox, physical, etc.):

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

In the meantime, we could adjust the installation docs, and add runc and containerd to the list of packages to uninstall before installing.https://docs.docker.com/install/linux/docker-ce/ubuntu/#uninstall-old-versions 🤔

FWIW; the following changes were merged in the rpm and deb packages for containerd (and should to out with an upcoming version of the package);

deb spec (“control” file);

Package: containerd.io
...
Provides: containerd, runc
Conflicts: containerd, runc
Replaces: containerd, runc

RPM spec;

Name: containerd.io
Provides: containerd
Provides: runc

# Obsolete packages
Obsoletes: containerd
Obsoletes: runc

# Conflicting packages
Conflicts: containerd
Conflicts: runc

I have the same issue. I am kind of blocked in my job. I even can’t use apt-get process properly after I added docker repo. Try to install:

dslocal@dslocal-JB:~/Work$ sudo apt-get install docker-ce
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils libqt5x11extras5 libsdl-image1.2 libva-drm1 libva-x11-1 libxcb-composite0 libxcb-xv0 linux-headers-4.15.0-36
  linux-headers-4.15.0-36-generic linux-headers-4.15.0-38 linux-headers-4.15.0-38-generic linux-image-4.15.0-36-generic
  linux-image-4.15.0-38-generic linux-modules-4.15.0-36-generic linux-modules-4.15.0-38-generic linux-modules-extra-4.15.0-36-generic
  linux-modules-extra-4.15.0-38-generic runc ubuntu-fan vlc-plugin-notify vlc-plugin-samba
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  containerd.io
The following NEW packages will be installed:
  containerd.io docker-ce
0 upgraded, 2 newly installed, 0 to remove and 216 not upgraded.
Need to get 17.4 MB/37.2 MB of archives.
After this operation, 173 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://download.docker.com/linux/ubuntu xenial/stable amd64 docker-ce amd64 5:18.09.0~3-0~ubuntu-xenial [17.4 MB]
Fetched 17.4 MB in 1s (9,973 kB/s)    
(Reading database ... 437883 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)
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_5%3a18.09.0~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce (5:18.09.0~3-0~ubuntu-xenial) ...
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)
dslocal@dslocal-JB:~/Work$ sudo apt 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).
dslocal@dslocal-JB:~/Work$ 

Try to fis broken:

dslocal@dslocal-JB:~/Work$ sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  bridge-utils libqt5x11extras5 libsdl-image1.2 libva-drm1 libva-x11-1 libxcb-composite0 libxcb-xv0 linux-headers-4.15.0-36
  linux-headers-4.15.0-36-generic linux-headers-4.15.0-38 linux-headers-4.15.0-38-generic linux-image-4.15.0-36-generic
  linux-image-4.15.0-38-generic linux-modules-4.15.0-36-generic linux-modules-4.15.0-38-generic linux-modules-extra-4.15.0-36-generic
  linux-modules-extra-4.15.0-38-generic runc ubuntu-fan vlc-plugin-notify vlc-plugin-samba
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  containerd.io
The following NEW packages will be installed:
  containerd.io
0 upgraded, 1 newly installed, 0 to remove and 216 not upgraded.
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 ... 437892 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)

Try to remove:

dslocal@dslocal-JB:~/Work$ sudo apt-get remove docker docker-engine docker.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'docker-engine' is not installed, so not removed
Package 'docker' is not installed, so not removed
Package 'docker.io' is not installed, so not removed
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).

How could I solve this? Even how it happened? Because my docker was working. It just stoped to work maybe after some update. I am able to use package manager only if I remove docker repository. Thank you, Jan.

Thanks for reporting; I opened an internal issue for the packaging team, and opened a “WIP” pull-request in the containerd packaging repo (sorry, looks like it’s still private, so can’t link to it) to try to address this.

One thing I commented on that PR is that we should verify if this will cause issues in future, once runc becomes stable (reaches 1.0), which I just saw being proposed on the runc mailinglist. At that point we may want to allow depending on the distro packages and/or put runc in its own package.

(Currently, the runc version is bundled with the containerd package, and pinned to a specific commit, to prevent incompatibility issues: https://github.com/containerd/containerd/blob/b1e202c32724e82779544365528a1a082b335553/RUNC.md)