8
votes

Command: yum -y install docker-ce

Result:

Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package docker-ce.x86_64 0:18.06.0.ce-3.el7 will be installed --> Processing Dependency: container-selinux >= 2.9 for package: docker-ce-18.06.0.ce-3.el7.x86_64 --> Finished Dependency Resolution Error: Package: docker-ce-18.06.0.ce-3.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2.9 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

6

6 Answers

10
votes

Resolved with installing container-selinux-2.9 dependency with following command:

sudo yum install ftp://bo.mirror.garr.it/1/slc/centos/7.1.1503/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm
5
votes

Use below link to install container-selinux from a trust able source

sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.55-1.el7.noarch.rpm

Steps to install Docker-CE on RHEL 7.5

https://github.com/dineshsood/dockers/wiki

4
votes

This docker-ce version worked for me:

   sudo yum -y install docker-ce-cli.x86_64 1:19.03.5-3.el7

Best of luck!

1
votes

You can enable the Extras repository in the path:

/etc/yum.repos.d/CentOS-Base.repo
1
votes

You need to enable CentOS "extras" repository.

Here's how I did it:

  1. Open /etc/yum.repos.d/CentOS-Base.repo
  2. Duplicate contents of the file, so it becomes twice as long
  3. Replace /os/ in the URL with /extras/
  4. Change the section title in square brackets

E.g.:

[CentOS-Base]
name=CentOS 7 Base Mirror
baseurl=http://mirror.centos.org/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[CentOS-Extras]
name=CentOS 7 Extras
baseurl=http://mirror.centos.org/centos/7/extras/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Then try installing docker again

0
votes

I had to add --nogpgcheck to the selected answer de to an error

Public key for container-selinux-2.9-4.el7.noarch.rpm is not installed