for-linux icon indicating copy to clipboard operation
for-linux copied to clipboard

CentOS 7/RHEL 7 installations broken where $releasever is '7Server'

Open ineffyble opened this issue 6 years ago • 64 comments

  • [x] This is a bug report
  • [x] I searched existing issues before opening this one

Expected behavior

yum install is able to install docker-ce from the repo provided at http://download.docker.com/linux/centos/docker-ce.repo when the $releasever variable is set to 7Server.

Actual behavior

At some point in the last week, this has stopped working, and https://download.docker.com/linux/centos/7Server is now a 404. I suspect this coincides with the release of the CentOS 8 packages.

https://download.docker.com/linux/centos/7 still exists, but that is not the same $releasever and so the repo reference in http://download.docker.com/linux/centos/docker-ce.repo is broken.

Steps to reproduce the behavior

Attempt to install Docker from the provided CentOS/RHEL repo with an installation of CentOS/RHEL that has 7Server set as the yum releasever.

ineffyble avatar Sep 24 '20 01:09 ineffyble

This broke a bunch of deployments for us and caused much yak shaving today. I'd very much appreciate the 7Server being restored.

gdhgdhgdh avatar Sep 24 '20 11:09 gdhgdhgdh

Is this both on CentOS and RHEL machines? Does CentOS also set the Server suffix?

thaJeztah avatar Sep 24 '20 12:09 thaJeztah

I opened a PR with a workaround for our install script https://github.com/docker/docker-install/pull/194 (but for manual installations, something similar will have to be done);

If you're on RHEL7/CentOS7 and have this issue:

for channel in "stable" "test"; do \
    yum-config-manager --setopt="docker-ce-${channel}.baseurl=https://download.docker.com/linux/centos/7/\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-debuginfo.baseurl=https://download.docker.com/linux/centos/7/debug-\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-source.baseurl=https://download.docker.com/linux/centos/7/source/${channel}" --save; \
done

If you're on RHEL8 and have this issue:

for channel in "stable" "test"; do \
    yum-config-manager --setopt="docker-ce-${channel}.baseurl=https://download.docker.com/linux/rhel/8/\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-source.baseurl=https://download.docker.com/linux/rhel/8/source/${channel}" --save; \
done

If you're on RHEL9 and have this issue:

for channel in "stable" "test"; do \
    yum-config-manager --setopt="docker-ce-${channel}.baseurl=https://download.docker.com/linux/rhel/9/\$basearch/${channel}" --save; \
    yum-config-manager --setopt="docker-ce-${channel}-source.baseurl=https://download.docker.com/linux/rhel/9/source/${channel}" --save; \
done

thaJeztah avatar Sep 24 '20 14:09 thaJeztah

I'm experiencing this on RHEL 7.7.

Running your workaround @thaJeztah gives me:

No package docker-ce available.
Error: Nothing to do

andrewbanchich avatar Sep 25 '20 14:09 andrewbanchich

@andrewbanchich The work-around only works if you are using the CentOS version of Docker on RHEL. Red Hat no longer supports Docker so many people switched to using the CentOS version of Docker on RHEL.

Run the CentOS installation instructions on RHEL https://docs.docker.com/engine/install/centos/ But before you $ sudo yum install docker-ce docker-ce-cli containerd.io run the work-around.

One more thing. When switching to the Docker for CentOS watch out for https://github.com/docker/for-linux/issues/477

ghost avatar Sep 25 '20 16:09 ghost

I am getting the following error after running the workaround to fix the broken repo link.

sudo yum install docker-ce docker-ce-cli containerd.io Loaded plugins: langpacks, ulninfo docker-ce-stable | 3.5 kB 00:00:00 ksplice-uptrack | 951 B 00:00:00 ol7_UEKR5 | 2.5 kB 00:00:00 ol7_addons | 2.5 kB 00:00:00 ol7_developer | 2.5 kB 00:00:00 ol7_developer_EPEL | 2.7 kB 00:00:00 ol7_latest | 2.7 kB 00:00:00 ol7_optional_latest | 2.5 kB 00:00:00 ol7_software_collections | 2.5 kB 00:00:00 (1/2): docker-ce-stable/x86_64/updateinfo | 55 B 00:00:00 (2/2): docker-ce-stable/x86_64/primary_db | 6.4 kB 00:00:00 No package docker-ce available. No package docker-ce-cli available. No package containerd.io available. Error: Nothing to do

msbecker avatar Sep 25 '20 17:09 msbecker

@msbecker "ol7" is Oracle Linux 7. Can you please share the output of yum repolist ? Thanks.

ghost avatar Sep 25 '20 17:09 ghost

@mettacrawler I tried this on a clean RHEL 7.7 server and getting the same results.

When I run the workaround, it outputs

================================================ repo: rhui-rhel-7-server-rhui-rpms ================================================
[rhui-rhel-7-server-rhui-rpms]

followed by a bunch of vars to the console. Then I run the install command:

[ec2-user@ip~]$ sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: amazon-id, search-disabled-repos
docker-ce-stable                                                                                             | 3.5 kB  00:00:00
rhui-client-config-server-7                                                                                  | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rh-common-rpms                                                                       | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rpms                                                                                 | 2.0 kB  00:00:00
(1/2): docker-ce-stable/x86_64/updateinfo                                                                    |   55 B  00:00:00
(2/2): docker-ce-stable/x86_64/primary_db                                                                    | 6.4 kB  00:00:00
No package docker-ce available.
No package docker-ce-cli available.
No package containerd.io available.
Error: Nothing to do

andrewbanchich avatar Sep 25 '20 17:09 andrewbanchich

@andrewbanchich Did you follow these instructions? https://docs.docker.com/engine/install/centos/

Run the CentOS installation instructions on RHEL https://docs.docker.com/engine/install/centos/ But before you $ sudo yum install docker-ce docker-ce-cli containerd.io run the work-around.

One more thing. When switching to the Docker for CentOS watch out for https://github.com/docker/for-linux/issues/477

ghost avatar Sep 25 '20 17:09 ghost

Yes, I followed those instructions and did exactly that. Is the workaround supposed to output those var settings to the console?

andrewbanchich avatar Sep 25 '20 17:09 andrewbanchich

Please try:

sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save

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

ghost avatar Sep 25 '20 17:09 ghost

@mettacrawler After running both commands:

[ec2-user@ip ~]$ sudo yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: amazon-id, search-disabled-repos
docker-ce-stable                                                                                             | 3.5 kB  00:00:00
rhui-client-config-server-7                                                                                  | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rh-common-rpms                                                                       | 2.1 kB  00:00:00
rhui-rhel-7-server-rhui-rpms                                                                                 | 2.0 kB  00:00:00
docker-ce-stable/primary_db                                                                                  |  46 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.3.7-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.3.7-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.13-3.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-19.03.13-3.el7.x86_64
---> Package docker-ce-cli.x86_64 1:19.03.13-3.el7 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-19.03.13-3.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.3.7-3.1.el7.x86_64 (docker-ce-stable)
           Requires: container-selinux >= 2:2.74
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Update: If I do the follow then it works (again). Thanks @mettacrawler

sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
sudo yum install -y docker-ce docker-ce-cli

andrewbanchich avatar Sep 25 '20 17:09 andrewbanchich

@andrewbanchich I'm guessing you are stuck with RHEL 7.7 and can't switch to 7.8 for some reason, right?

ghost avatar Sep 25 '20 17:09 ghost

@mettacrawler Correct. Actually I need to use this on 7.6, but I didn't think there would be a huge difference between dot releases.

andrewbanchich avatar Sep 25 '20 17:09 andrewbanchich

@andrewbanchich please see https://access.redhat.com/solutions/5154

ghost avatar Sep 25 '20 18:09 ghost

Still pointing to wrong URL after running the fix from above.

@mettacrawler sudo yum repolist Loaded plugins: langpacks, ulninfo repo id repo name status docker-ce-stable/7Server/x86_64 Docker CE Stable - x86_64 17 ksplice-uptrack/7Server/x86_64 Ksplice Uptrack for Oracle Linux 18 nodesource/x86_64 Node.js Packages for Enterprise Linux 7 - x86_64 94 ol7_UEKR5/x86_64 Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64) 280 ol7_addons/x86_64 Oracle Linux 7Server Add ons (x86_64) 467 ol7_developer/x86_64 Oracle Linux 7Server Development Packages (x86_64) 1,503 ol7_developer_EPEL/x86_64 Oracle Linux 7Server Development Packages (x86_64) 33,021 ol7_latest/x86_64 Oracle Linux 7Server Latest (x86_64) 19,428 ol7_optional_latest/x86_64 Oracle Linux 7Server Optional Latest (x86_64) 14,174 ol7_software_collections/x86_64 Software Collection Library release 3.0 packages for Oracle Linux 7 (x86_64)

msbecker avatar Sep 25 '20 18:09 msbecker

Yeah, I had this same problem on a fresh RHEL 7.8 this afternoon. The workaround of changing the base paths resulted in

yum install -y docker-ce docker-ce-cli containerd.io

Loaded plugins: enabled_repos_upload, package_upload, product-id, search-disabled-repos, subscription-manager No package docker-ce available. No package docker-ce-cli available. No package containerd.io available. Error: Nothing to do

for me as well.

mrhorvath avatar Sep 25 '20 20:09 mrhorvath

We are using releasever 7.8. Is there an expectation that this will be fixed in the repo 'in the near term' so that these workarounds are not required?

Regards.

jamesoc avatar Sep 25 '20 20:09 jamesoc

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
sudo yum install -y yum-utils
sudo yum-config-manager \
     --add-repo \
     https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --setopt="docker-ce-stable.baseurl=https://download.docker.com/linux/centos/7/x86_64/stable" --save
sudo yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
sudo systemctl start docker
sudo docker run -it --name hello-world --rm hello-world

ghost avatar Sep 26 '20 00:09 ghost

@mettacrawler I can confirm your latest workaround did the trick. I was able to install docker using those steps.

msbecker avatar Sep 27 '20 01:09 msbecker