错误描述
yum添加完docker源的地址,执行 yum makecache后返回如下的问题
yum makecache
failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://download.docker.com/linux/centos/$releasever/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
问题解决
出现上面的问题,是因为缺少$releasever环境变量, 将$releasever 替换成对应的系统版本
vi /etc/yum.repos.d/docker-ce.repo
[docker-ce-stable]
name=Docker CE Stable - $basearch
#baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg