Score:2

Unmet dependencies: containerd : Breaks: docker.io

I have a Ubuntu 18.04.6 LTS machine that cannot be updated due to a dependency error, which I don't know how to solve.

It started after I did do-release-upgrade from 16.04.7.

  1. apt update works fine, then apt upgrade gives this error:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
    containerd : Breaks: docker.io (< 19.03.13-0ubuntu4) but 18.09.7-0ubuntu16.04.7 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
  1. I try apt --fix-broken install, as suggested, but it gives yet another error, and this time, a very unespecific one:
dpkg: error processing archive /var/cache/apt/archives/docker.io_20.10.12-0ubuntu2~18.04.1_amd64.deb (--unpack):
Error were encountered while processing:
    /var/cache/apt/archives/docker.io_20.10.12-0ubuntu2~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg/ returned an error code (1)
  1. As it suggest me to run apt autoremove, I try that command instead, which leads me to the first error again:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
    containerd : Breaks: docker.io (< 19.03.13-0ubuntu4) but 18.09.7-0ubuntu16.04.7 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
  • How to stop this circular error throwing and update the machine?

Please add apt-cache policy containerd docker.io to your question.

Here it is:

:~# apt-cache policy containerd docker.io
containerd:
    Installed:  1.5.9-0ubuntu1~18.04.2
    Candidate:  1.5.9-0ubuntu1~18.04.2
    Version table:
    *** 1.5.9-0ubuntu1~18.04.2 500
            500 http://br.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
            500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
            100 /var/lib/dpkg/status
        0.2.5-0ubuntu2 500
            500 http://br.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
docker.io:
    Installed:  18.09.7-0ubuntu1~16.04.7
    Candidate:  20.10.12-0ubuntu1~18.04.1
    Version table:
        20.10.12-0ubuntu2~18.04.1 500
            500 http://br.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
        20.10.7-0ubuntu5~18.04.3 500
            500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
    *** 18.09.7-0ubuntu1~16.04.7 100
            100 /var/lib/dpkg/status
        17.12.1-0ubuntu1 100
            500 http://br.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

Try apt install --reinstall docker.io=20.10.12-0ubuntu1~18.04.1

Error, similar, but more detailed than the one returned by apt --fix-broken install:

dpkg: error processing archive /var/cache/apt/archives/docker.io_20.10.12-0ubuntu2~18.04.1_amd64.deb (--unpack):
    new docker.io package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
    /var/cache/apt/archives/docker.io_20.10.12-0ubuntu2~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg/ returned an error code (1)

Try apt upgrade docker.io.

Error, the same previously returned by apt update and apt autoremove:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
    containerd: Breaks: docker.io (< 19.03.13-0ubuntu4) but 18.09.7-0ubuntu1~16.04.7 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
nobody avatar
gh flag
Please add `sudo apt update` to your question. And also `apt-cache policy containerd docker.io`
user535733 avatar
cn flag
Well, your output shows that you are trying to run a 16.04 version of containerd on an 18.04 system, and the two are incompatible. You generally solve it by uninstalling that 16.04 version of containerd, removing whatever source is pulling in that 16.04 version, and then reinstalling a proper 18.04 version from the normal Ubuntu repositories...
user535733 avatar
cn flag
...HOWEVER, your 18.04 system goes out of Standard Support in two months. After that, we don't answer questions about it anymore. Time to consider migrating all of your containers to a freshly-installed 22.04 system.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@nobody My question already has `apt update` on step 1. `sudo` is not needed, as I logged in as root on the console.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@user535733 I forgot to mention on the question description, that the error started after `do-release-upgrade` from 16.04.7. That's why it is trying to run the 16.04.7 version of containerd.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@nobody I have added `apt-cache policy containerd docker.io` to my question description, as you asked.
nobody avatar
gh flag
`sudo apt install --reinstall docker.io=20.10.12-0ubuntu1~18.04.1` If this is not working show `sudo apt upgrade docker.io`
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@user535733 I already know that 18.04 is reaching end of life. I want to fix this circular error in order to be able to do another `do-release-upgrade` as soon as I can.
user535733 avatar
cn flag
It's not a "circular error." Everything you have shown us so far points to an ordinary self-inflicted version conflict, similar to thousands of others, and among the most common questions here. @nobody's approach is exactly right, and that person has long experience with these. Almost all version conflicts are self-inflicted: You likely apt-marked or pinned or PPAd or otherwise introduced the problem yourself, possibly many years ago while running 16.04. It's very easy to solve if you can disclose what you did. It's sometimes very hard to solve if you don't recall.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@nobody I edited the question description to add the errors returned by the last commands that you asked me to try.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@user535733 Thanks for clarifying. But be sure that I did not 'introduce the problem myself many years ago while running 16.04', as I'm not the owner of this server, which I received for fixing, not a long time ago, already totally non-operational, [stuck on emergency mode with a dead HDD](https://unix.stackexchange.com/questions/735793/ubuntu-gives-message-welcome-to-emergency-mode-fsck-just-says-clean).
user535733 avatar
cn flag
Apologies for erroneous assumptions. Have you tested the containers in a 20.04 testing environment? It would stink to fix the package problem and successfully release-upgrade only to learn that it broke whatever is in the containers. After a successful test, simply uninstall containerd and docker.io, then run the release-upgrade, then reinstall containerd and docker.io from the Ubuntu repositories.
nobody avatar
gh flag
Oh that's not so good it seems you have to migrate your containers. But i can not help further. https://askubuntu.com/questions/1361206/docker-upgrade-failure-the-aufs-storage-driver-is-no-longer-supported
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@user535733 No problem, I'm not offended. About the containers, I asked the human owner and he said the containers can just be deleted. It is more important for him to have the most recent OS version than to keep long-forgotten containers. So I just need to do `rm -r /var/lib/docker/aufs`, then `apt remove containerd`, and `apt remove docker.io`, right?
user535733 avatar
cn flag
You are on the right track!
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
sj flag
@nobody You really discovered which was the problem! It really was the `aufs storage-driver` support being dropped that got the updates stuck -- the error message that I completely ignored. Would you like to formally provide the answer to this question, that is, to not ignore the `aufs storage-driver` support warning to do `rm -r /var/lib/docker/aufs` plus `apt remove docker.io`? (no need for `apt remove containerd`).
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@user535733 Since the user "nobody" did not want to provide a formal answer, would you like to? It's like he said: the `aufs storage-driver` support was dropped and I needed to do `rm -r /var/lib/docker/aufs` plus `apt remove docker.io`. I did and then was free to use `apt upgrade` again.
user535733 avatar
cn flag
You are welcome to write the answer to your own question.
Rishon JR avatar
pl flag
+1 for formatting.
Score:0

Steps that I used to fix it:

  1. rm -r /var/lib/docker/aufs
  2. apt remove docker.io

Or in one command: rm -r /var/lib/docker/aufs && apt remove docker.io

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.