docker-ce : Depends: libseccomp2 (>= 2.3.0) but 2.2.3-3ubuntu3 is to be installed
Asked Answered
C

13

32

I'm installing Docker on my Ubuntu machine and I'm following this tutorial Install Docker Engine on Ubuntu

When I run sudo apt-get install -y docker-ce it does not install Docker on my machine and is giving the following error:

$ sudo apt-get install -y docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 docker-ce : Depends: libseccomp2 (>= 2.3.0) but 2.2.3-3ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.

When I run sudo apt-get install libseccomp2, it already installed in my system and I am still getting same error when I try to install Docker on my machine.

Here is the information of my Ubuntu OS:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
Camshaft answered 28/12, 2017 at 6:2 Comment(1)
its a ubuntu question its better to ask over on askubuntu.com ... when you googled on ` you have held broken packages` ... issue this ... sudo apt-get -f installVelvetvelveteen
K
20

I encounter the same problem when installing docker-ce version 18. I won't use aptitude to install the old version because nvidia-docker only supports Docker version above 18!

The solution is quite easy:

sudo add-apt-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update

Then you can use command sudo apt-get install docker-ce to solve the libseccomp2 version conflict problem.

Reference: https://gist.github.com/mingrui/187f0e629007443268ce8c1414012ed5

Koski answered 26/11, 2018 at 12:51 Comment(2)
This works for ubuntu14.04 when install docker 18.06.3/stable version, thanksCanasta
I was stuck with an old 16.04 install, and this was exactly what I needed.Hooper
D
19

I had the same issue on Ubuntu 16. I almost tried all solutions. The following command runs for me.

sudo apt install docker.io

But I have noticed that now the latest version are installing using docker-ce. docker.io is an older version. But in order to fix the issue you have to find a compatible version.

For me the following command is running by specifying the version name.

apt install docker-ce=17.12.0~ce-0~ubuntu

The following command will list you the available version list. You can try one after another from top to bottom.

apt-cache madison docker-ce
Decalogue answered 30/3, 2018 at 12:52 Comment(1)
I have docker version 1.x and installing docker everytime its on version 1.x only, After following this step I got docker version 17.x, thank youMover
M
13

I am on Linux Mint (Ubuntu 16.04 (Xenial Xerus)).

I had the exact same error.

The solution is from here: https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce-1

I think you require a specific version like this (I choose the xenial version - latest):

patrikx3@workstation:~$ sudo -i
[sudo] password for patrikx3:
root@workstation:~# apt-cache madison docker-ce
 docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.09.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.2~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.06.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.2~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
 docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
root@workstation:~# apt install docker-ce=17.03.2~ce-0~ubuntu-xenial
Reading package lists... Done
Building dependency tree
Reading state information... Done
docker-ce is already the newest version (17.03.2~ce-0~ubuntu-xenial).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@workstation:~#

For the pure ubuntu it was not working.

Multilingual answered 1/3, 2018 at 17:51 Comment(1)
I don't think Ubuntu is based on Linux Mint (Debian, rather).Lossa
B
9

The best solution for me was just adding the libseccomp2's repository by myself and update the package, and then I haven't had to change the steps on Docker's site tutorial.

I used the link of the Debian's package (https://packages.debian.org/pt-br/sid/libseccomp2).

In my case I needed the 2.4 version, so in the Download section I clicked in the amd64 and followed the instruction to simply add deb http://ftp.de.debian.org/debian sid main to the /etc/apt/sources.list file.

After that I ran:

$ sudo apt-get install libseccomp2

And the library was updated and I perfect installed Docker.

Biography answered 28/12, 2019 at 14:34 Comment(0)
G
8

I found codersquirrel's answer very helpful.

Just to add to it.

Do the following:

Run the command below to add the libseccomp2 repository:

add-apt-repository "deb http://ftp.de.debian.org/debian sid main"

Update your apt repository:

apt-get update

Install libseccomp2:

apt-get install libseccomp2

That's all.

I hope this helps

Gringo answered 12/4, 2020 at 11:5 Comment(0)
S
5

I have the same problems on Linux Mint 18.3. I was installing manually from: http://launchpadlibrarian.net/344879847/libseccomp2_2.3.1-2.1ubuntu2~16.04.1_amd64.deb

I didn't remove the old version.

After installing libseccomp2, installing docker-ce worked like a charm.

Sulfanilamide answered 10/4, 2018 at 15:30 Comment(0)
J
4

I had a similar problem. I got it over using aptitude instead of apt:

$ sudo aptitude install docker-ce

Skip any solutions and accept the one where it claims to resolve any conflicting dependencies:

The following actions will resolve these dependencies:

     Install the following packages:                    
1)     docker-ce [17.04.0~ce-0~debian-stretch (stretch)]



Accept this solution? [Y/n/q/?] y

Let aptitude do its work and it should then install docker-ce.

$ docker --version
Docker version 17.04.0-ce, build 4845c56
Jaclynjaco answered 2/1, 2018 at 14:43 Comment(1)
root@workstation:~# aptitude install docker-ce The following NEW packages will be installed: docker-ce{b} Accept this solution? [Y/n/q/?] y No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.Multilingual
R
4

For Ubuntu 16.04.1 (Xenial Xerus) or newer, libseccomp2 exists in version 2.3 in Xenial updates. To install it, check if you have checked:

System settingsSoftware & updates → *Updates: Recommended updates

Then:

sudo apt update
sudo apt upgrade
Rebroadcast answered 12/1, 2018 at 22:17 Comment(1)
This is also valid for 18.04, didn't need to do the upgrade, but adding the recommended updates (Ubuntu Updates Main amd64) added the list which contained the latest version of the libseccomp2 required by docker.Oil
A
3

I got a Ubuntu server from our operations and had the same issue.

When I started to dig, it appeared than in file /etc/apt/sources.list the URLs to the packages repositories are broken.

In my case it was:

deb http://ubuntu-mirror/ubuntu/ xenial universe

After changing ubuntu-mirror to de.archive.ubuntu.com in each line, you will get a valid /etc/apt/sources.list file with URLs.

deb http://de.archive.ubuntu.com/ubuntu/ xenial universe

then

sudo apt update
sudo apt upgrade
sudo apt install -y docker-ce

PS: Operations updated the old Ubuntu 10.04 (Lucid Lynx) to Ubuntu 16.04 (Xenial Xerus) and the repositories were broken after the update.

Avoirdupois answered 21/3, 2018 at 15:53 Comment(1)
it is true, actually, i had to change mirror, and now i could update docker to docker-ce 18. weird, before i was using only 17.03.2~ce-0~ubuntu-xenial with apt-cache madison docker-ce, that I could work it ubuntu-xenial, but I updated the mirrors and that's what the problem!!!!Multilingual
E
1
sudo apt-get install -y libltdl7 libseccomp2
Elegant answered 9/10, 2019 at 8:30 Comment(1)
An explanation would be in order.Lossa
D
1

You can run apt --fix-broken install without any packages or you can specify it.

Decompensation answered 30/10, 2019 at 13:20 Comment(0)
E
0

You can run sudo apt-get -f install docker-ce docker-ce-cli with force.

Eulogist answered 24/7, 2020 at 20:19 Comment(1)
What do you mean by "with force"? It probably refers to the "-f" flag, but perhaps rephrase (by editing your answer)?Lossa
M
0

On bionic, Ubuntu 18, Resolved for me by installing the updated packages libseccomp2 2.4.3 via below link

https://launchpad.net/ubuntu/bionic/+package/libseccomp2

Madrid answered 10/11, 2021 at 10:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.