skip to Main Content

Edit: I’d still like an answer to this question if possible, but I have managed to work around it by directly installing the individual rpms rather than relying on yum to do it for me.

I’m struggling with installing docker-ce on a CentOS 7 box. I have it installed on three other boxes, but the fourth is giving me problems. I am following the instructions here. Installing the repo appears to work, but docker-ce doesn’t appear to be available no matter what I try.

$ sudo yum-config-manager 
>     --add-repo 
>     https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

$ ls /etc/yum.repos.d/docker-ce.repo
/etc/yum.repos.d/docker-ce.repo

# This should include docker-ce, docker-ce-cli, and a few other things
$ yum --disablerepo="*" --enablerepo="docker-ce-stable" list available
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
containerd.io.x86_64                                 1.2.6-3.3.el7                                  docker-ce-stable

$ sudo yum install docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.fileplanet.com
 * epel: mirror.colorado.edu
 * extras: mirrors.tummy.com
 * updates: mirrors.tummy.com
No package docker-ce available.
Error: Nothing to do

The repo is obviously enabled. I am able to install containerd.io from the repo. It just appears that nothing else is available in the repo. Even when I copy the repo from another CentOS7 box where it works, I still don’t see the docker-ce package. This repo worked fine on three other boxes tonight.

Any help would be appreciated. Thanks in advance!

Edit:

Running yum clean all and yum update have not helped.

$ rm /etc/yum.repos.d/docker-ce.repo
rm: remove regular file ‘/etc/yum.repos.d/docker-ce.repo’? y

$ yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 18 M of disk space (use --verbose for details)

$ yum update
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel/x86_64/metalink                                                                         |  14 kB  00:00:00
 * base: repos.forethought.net
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: repos.forethought.net
 * updates: repos.forethought.net
base                                                                                         | 3.6 kB  00:00:00
epel                                                                                         | 5.4 kB  00:00:00
extras                                                                                       | 2.9 kB  00:00:00
updates                                                                                      | 2.9 kB  00:00:00
(1/7): base/7/x86_64/group_gz                                                                | 165 kB  00:00:00
(2/7): base/7/x86_64/primary_db                                                              | 6.0 MB  00:00:00
(3/7): epel/x86_64/group_gz                                                                  |  90 kB  00:00:00
(4/7): epel/x86_64/updateinfo                                                                | 1.0 MB  00:00:00
(5/7): extras/7/x86_64/primary_db                                                            | 153 kB  00:00:00
(6/7): updates/7/x86_64/primary_db                                                           | 2.8 MB  00:00:00
(7/7): epel/x86_64/primary_db                                                                | 6.9 MB  00:00:01
No packages marked for update

$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo

$ yum list available | grep docker-ce
containerd.io.x86_64                      1.2.10-3.2.el7                 docker-ce-stable

$ yum install docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: repos.forethought.net
 * epel: d2lzkl7pfhq30w.cloudfront.net
 * extras: repos.forethought.net
 * updates: repos.forethought.net
No package docker-ce available.
Error: Nothing to do
$ yum --disablerepo="*" --enablerepo="docker-ce-stable" list available
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
containerd.io.x86_64                                 1.2.10-3.2.el7                                 docker-ce-stable

4

Answers


  1. Try the following steps:

    • Create a directory /etc/yum.repos.d/disabled and move everything from /etc/yum.repos.d to this new directory
    • Run yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo. Now you should see a docker-ce.repo file under /etc/yum.repos.d.
    • Run yum clean all && yum list available and then check if you see
      docker-ce.x86_64 among the available packages
    Login or Signup to reply.
  2. There are many ways of enforcing yum to exclude a repo. One of them is by setting the exclude directive on /etc/yum.conf. This config has priority over the --disablerepo and --enablerepo flags.

    You must check your /etc/yum.conf, removing the exclude or forcing yum to ignore it using the --disableexcludes=all flag.

    --disableexcludes=[all|main|repoid]
    Disable  the excludes defined in your config files. Takes one of three options:
    
    all == disable all excludes
    main == disable excludes defined in [main] in yum.conf
    repoid == disable excludes defined for that repo
    

    e.g:

    yum --disablerepo="*" --enablerepo="docker-ce-stable" --disableexcludes=all list available

    Login or Signup to reply.
  3. Execute the command below and try it.

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

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

    Login or Signup to reply.
  4. try installing it without slash ”

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

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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search