1、安装依赖
[root@template ~]# yum -y install yum-utils
2、添加依赖
[root@template ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、查看都有哪些仓库
[root@template ~]# yum repolist all
[root@template ~]# yum-config-manager |grep "======="
4、禁用docker-ce-stable仓库
[root@template ~]# yum-config-manager --disable docker-ce-stable
5、再次查看都有哪些仓库,看下被禁用的是佛能看到
[root@template ~]# yum-config-manager |grep "======="
6、启动被禁用的仓库
[root@template ~]# yum-config-manager --enable docker-ce-stable
打印启动yum源仓库内容信息表示启动成功,如果不打印信息可能yum源名称写错了
7、再次查看yum源列表
[root@template ~]# yum-config-manager --showduplicates|grep "==="