[docker] Docker CE on RHEL - Requires: container-selinux >= 2.9

I am trying to install Docker CE on RHEL using this link. This is my RHEL version:

Red Hat Enterprise Linux Server release 7.3 (Maipo)

When I execute this:

sudo yum -y install docker-ce

I am getting this error:

Error: Package: docker-ce-17.06.0.ce-1.el7.centos.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

I tried using --skip-broken and rpm -Va --nofiles --nodigest but again getting the same error. Please let me know how to resolve this issue and install Docker CE in RHEL 7.3.

This question is related to docker unix rhel

The answer is


Error: Package: 2:container-selinux-2.74-1.el7.noarch (rhel-7-server-extras-rpms)

Requires: selinux-policy >= 3.13.1-216.el7

Installed: selinux-policy-3.13.1-192.el7_5.6.noarch (@rhel-7-server-rpms)

selinux-policy = 3.13.1-192.el7_5.6

there is dependency issue with the container-selinux version

to fix this error on rhel 7.x i have performed the below things

1) yum install http://vault.centos.org/centos/7.3.1611/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm

2) yum install -y yum-utils device-mapper-persistent-data lvm2

3) yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

4 ) yum install docker-ce

now start the docker service


Docker CE is not supported on RHEL. Any way you are trying to get around that is not a supported way. You can see the supported platforms in the Docker Documentation. I suggest you either use a supported OS, or switch to Enterprise Edition.


To update container-selinux I had to install epel-release first:

Add Centos-7 repository

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Install epel-release

yum install epel-release

Update container-selinux

yum install container-selinux

this link helped me to solve this issue

Here is the solution: For centos: try

sudo yum install --setopt=obsoletes=0 \
>    docker-ce-17.03.2.ce-1.el7.centos.x86_64 \
>    docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch

For Rhel:

sudo yum install --setopt=obsoletes=0 docker-ce-17.03.3.ce-1.el7.x86_64.rpm docker-ce-selinux-17.03.3.ce-1.el7.noarch.rpm

Installing the Selinux from the Centos repository worked for me:
1. Go to http://mirror.centos.org/centos/7/extras/x86_64/Packages/
2. Find the latest version for container-selinux i.e. container-selinux-2.21-1.el7.noarch.rpm
3. Run the following command on your terminal: $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/**Add_current_container-selinux_package_here**
4. The command should looks like the following $ sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.21-1.el7.noarch.rpm
Note: the container version is constantly being updated, that is why you should look for the latest version in the Centos' repository


You have already have container-selinux installed for version 3.7 check if the following docker-ce version works for you , it did for me.

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

[SOLVED] Simple one command to fix this issue.

yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm

To resolve the following error I was facing to install docker-ce on RHEL-7

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

Please run following command before installing latest version of docker-ce

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

Once previous command runs successfully then install docker-ce with following command

yum -y install docker-ce

once installation is done then run

systemctl start docker

Note : Run all these commands with root user


Update June 2019

What a dogs dinner. Unfortunately, the other answers didn't work for me.

For the most part, the official docker instructions for installing using a repository DID work.

sudo yum install -y yum-utils \
  device-mapper-persistent-data \
  lvm2

Followed by:

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

However, I had to modify the next command as follows (adding --nobest):

sudo yum install docker-ce --nobest

Finally, check the docker client:

docker --version
Docker version 18.09.7, build 2d0083d

Note also, the above works for standard RHEL AMI on AWS, but not for the Amazon Linux AMI type. May also find referencing this github issue insightful.

Added bonus, I found the following additional commands helpful:

Start the docker daemon:

sudo systemctl start docker.service

Give the current user (in my case ec2-user - check with whoami) rights to the docker group. This avoids running everything with sudo.

sudo usermod -aG docker $USER

Now, logoff and login again as same user as before (in my case ec2-user).

At this point, everything should be working. Check the docker daemon:

docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

Try:

yum install http://vault.centos.org/centos/7.3.1611/extras/x86_64/Packages/container-selinux-2.9-4.el7.noarch.rpm

It worked for me.


Head to http://mirror.centos.org/centos/7/extras/x86_64/Packages/ and get the link to the latest container-selinux package. In my case the link was http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.68-1.el7.noarch.rpm

Head to your terminal as root and run:

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

After that you can proceed to install docker:

yum install docker-ce


On CentOS7 I had to follow the third install method, get-docker.sh https://docs.docker.com/install/linux/docker-ce/centos/#install-using-the-convenience-script


As with other answers, adding the "extras" subscribed channels to a CentOS 7 Spacewalk deployment solves this problem as well.


I was getting the same error Requires: container-selinux >= 2.9 on amazon ec2 instance(Rhel7)

I tried to add extra package rmp repo by executing sudo yum-config-manager --enable rhui-REGION-rhel-server-extras
but it works. followed steps from https://installdocker.blogspot.com/ and I was able to install docker.


I followed many links including the official documentation, however it all ended up in this error:

Requires: container-selinux >= 2.9
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

The only way it worked for me is as follows (yum upgrade worked I guess):

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

yum upgrade docker-ce

Just install selinux latest version to fix it:
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm

More versions at http://mirror.centos.org/centos/7/extras/x86_64/Packages/

Older versions of 2.9: http://ftp.riken.jp/Linux/cern/centos/7/extras/x86_64/Packages/


The best way to resolve this one is. Download the latest container-selinux package from http://mirror.centos.org/centos/7/extras/x86_64/Packages/ into the VM or the Machine where docker needs to be installed. Error : sometime it will ask for red hat subscription to download from repo. we can do it manually with out subscription as below Run the below command this will install dependencies manually rpm -i container-selinux-2.107-3.el7.noarch.rpm then run the yum install docker-ce

thanks Saa


Examples related to docker

standard_init_linux.go:190: exec user process caused "no such file or directory" - Docker What is the point of WORKDIR on Dockerfile? E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation How do I add a user when I'm using Alpine as a base image? docker: Error response from daemon: Get https://registry-1.docker.io/v2/: Service Unavailable. IN DOCKER , MAC How to fix docker: Got permission denied issue pull access denied repository does not exist or may require docker login Docker error: invalid reference format: repository name must be lowercase Docker: "no matching manifest for windows/amd64 in the manifest list entries" OCI runtime exec failed: exec failed: (...) executable file not found in $PATH": unknown

Examples related to unix

Docker CE on RHEL - Requires: container-selinux >= 2.9 What does `set -x` do? How to find files modified in last x minutes (find -mmin does not work as expected) sudo: npm: command not found How to sort a file in-place How to read a .properties file which contains keys that have a period character using Shell script gpg decryption fails with no secret key error Loop through a comma-separated shell variable Best way to find os name and version in Unix/Linux platform Resource u'tokenizers/punkt/english.pickle' not found

Examples related to rhel

Docker CE on RHEL - Requires: container-selinux >= 2.9 How to redirect output of systemd service to a file Completely remove MariaDB or MySQL from CentOS 7 or RHEL 7 RHEL 6 - how to install 'GLIBC_2.14' or 'GLIBC_2.15'? How to run a command as a specific user in an init script? Error when using scp command "bash: scp: command not found" How do you scroll up/down on the console of a Linux VM How to find which version of Oracle is installed on a Linux server (In terminal) Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist Installing Python 3 on RHEL