Docker on CentOS 7.6

I’m having issues installing Docker on CentOS distribution. I was following the official documentation but I keep getting the following error on this step:

$ sudo yum install docker-ce docker-ce-cli containerd.io

And the error is:

Error: Package: containerd.io-1.2.6-3.3.el7.x86_64 (docker-ce-stable)

Requires: container-selinux >= 2:2.74

Error: Package: 3:docker-ce-18.09.7-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

Following the other posts on StackOverflow I have tried adding the ‘extras’ repository (although it should have been enabled by default). I am running the sudo yum-config-manager --enable rhel-7-server-extras-rpms, but even after that sudo yum repolist doesn’t list it out. Instead I have Local Repository (not familiar with CentOS so much so I don’t know if this is normal).

I have also tried adding the missing package manually:

wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm; rpm -i container-selinux-2.21-1.el7.noarch.rpm

This is returning missing dependencies of its own:

Error: Package: libsemanage-python-2.5-5.1.el7_3.x86_64 (localrepo7)
           Requires: libsemanage = 2.5-5.1.el7_3
           Installed: libsemanage-2.5-14.el7.x86_64 (@base)
               libsemanage = 2.5-14.el7
           Available: libsemanage-2.5-4.el7.x86_64 (localrepo7)
               libsemanage = 2.5-4.el7
           Available: libsemanage-2.5-5.1.el7_3.x86_64 (localrepo7)
               libsemanage = 2.5-5.1.el7_3
Error: Package: audit-libs-python-2.6.5-3.el7_3.1.x86_64 (localrepo7)
           Requires: audit-libs(x86-64) = 2.6.5-3.el7_3.1
           Installed: audit-libs-2.8.4-4.el7.x86_64 (@base)
               audit-libs(x86-64) = 2.8.4-4.el7
           Available: audit-libs-2.6.5-3.el7.x86_64 (localrepo7)
               audit-libs(x86-64) = 2.6.5-3.el7
           Available: audit-libs-2.6.5-3.el7_3.1.x86_64 (localrepo7)
               audit-libs(x86-64) = 2.6.5-3.el7_3.1
           Available: audit-libs-2.7.6-3.el7.i686 (localrepo7)
              ~audit-libs(x86-32) = 2.7.6-3.el7
Error: Package: policycoreutils-python-2.5-11.el7_3.x86_64 (localrepo7)
           Requires: policycoreutils = 2.5-11.el7_3
           Installed: policycoreutils-2.5-29.el7_6.1.x86_64 (@updates)
               policycoreutils = 2.5-29.el7_6.1
           Available: policycoreutils-2.5-8.el7.x86_64 (localrepo7)
               policycoreutils = 2.5-8.el7
           Available: policycoreutils-2.5-11.el7_3.x86_64 (localrepo7)
               policycoreutils = 2.5-11.el7_3
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

But trying to manually install any of those returns for example:

Package matching libsemanage-2.5-5.1.el7_3.x86_64 already installed. Checking for update.

Did someone have similar issues?

Source: StackOverflow