Practice of installing docker CE in RedHat 7.3

Keywords: yum Docker CentOS RPM

This is also the first time to install docker CE on red hat. I encountered some problems, so I recorded them.

1. Modify the redhat source to the YUM source of centos7

Query yum installation package

rpm -qa | grep yum

Uninstall the original yum installation package

rpm -e yum-3.4.3-150.el7.noarch  --nodeps

rpm -e yum-utils-1.1.31-40.el7.noarch  --nodeps

rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64  --nodeps

Download all the packages required by centos






Install downloaded package

rpm -ivh yum-*

Download centosBase.repo

wget -O /etc/yum.repos.d/CentOS-Base.repo

vim /etc/yum.repos.d/CentOS-Base.repo

Replace all $release with 7, and use the replacement in vim


Clean up the YUM cache

Clean up the yum cache for the settings to take effect

yum clean all

Cache the package information on the server locally to improve the speed of searching and installing software

yum makecache

2. Install docker CE

Remove the original docker version

yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \

Update yum corresponding package

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

Add docker to install repo

yum-config-manager \
    --add-repo \

Install docker. The specified version is 18.09.6

yum install docker-ce-18.09.6 docker-ce-cli-18.09.6

Start docker, because my redhat does not have systemctl installed, all are started with service

service docker start


Posted by guanche on Fri, 08 Nov 2019 07:29:34 -0800