简体   繁体   中英

Docker won't install on Ubuntu 18.04

I'm trying to install according to the instructions .

Error when trying to install:

# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
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:
 containerd.io : Depends: libseccomp2 (>= 2.5.0) but 2.4.3-1ubuntu3.18.04.3 is to be installed
E: Unable to correct problems, you have held broken packages.

OS:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:    18.04
Codename:   bionic

# apt-get upgrade && apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Docker repo:

# cat /etc/apt/sources.list.d/docker.list 
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu   bionic stable

I tried to find information on how to update libseccomp2 for Ubuntu 18.04 but didn't find anything. Has anyone encountered such a problem?

I encountered the same issue and built it from source.

Uncomment the deb-src lines from /etc/apt/sources.list , then:

mkdir foo && cd foo
sudo apt-get update
sudo apt build-dep libseccomp2
apt-get source --compile libseccomp2
sudo dpkg -i libseccomp2_*.deb

It runs a lot of tests after the build which is time consuming. To skip those you add this before the apt-get source step:

export DEB_BUILD_OPTIONS=nocheck

After that, I was able to install Docker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM