[root@centos7h ~]# yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package epel-release available.
Error: Nothing to do
通常是yum源出现问题
检查yum源文件,一定要有这两个文件
如果没有需要重新下载centos官方repo文件(对于centos7)
第一种:curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repod 第二种(比较慢)---使用官方镜像源:curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml
运行
yum clean all
yum makecache
重新添加Docker CE官方仓库:
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum clean all
yum makecache
检查是否恢复成功
yum repolist
再使用yum install epel-release -y 就可以下载成功了