在安装软件时有如下提示:
[root@localhost ~]# yum install -y docker-io
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* epel: mirrors.yun-idc.com
* extras: mirrors.aliyun.com
* updates: mirror.bit.edu.cn
No package docker-io available.
Error: Nothing to do
问题原因:yum源问题,需要更改yum源。
解决方法:
移除原有yum源:
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-fasttrack.repo CentOS-Vault.repo epel-testing.repo
CentOS-Debuginfo.repo CentOS-Media.repo epel.repo
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
更新yum源
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2019-12-21 12:57:47-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com... 59.111.0.251
Connecting to mirrors.163.com|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo”
100%[==========================================>] 2,006 --.-K/s in 0s
2019-12-21 12:57:47 (10.9 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006]
将163yum源设置为新的默认yum源
[root@localhost yum.repos.d]# mv CentOS6-Base-163.repo CentOS-Base.repo
清理
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, refresh-packagekit, security
Cleaning repos: base epel extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
安装engine即可解决
yum install https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm