yum源位置
/etc/yum.repos.d
备份
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
获取阿里源
# yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# epel源
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
更新cache
yum makecache
.........
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/86dde93e0f467fb45a3140712d908f154a611a3377a2de5b5f4c750881e48f6c-other.sqlite.bz2: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/86dde93e0f467fb45a3140712d908f154a611a3377a2de5b5f4c750881e48f6c-other.sqlite.bz2: (28, 'Connection timed out after 30001 milliseconds')
正在尝试其它镜像。
(5/6): updates/7/x86_64/other_db | 1.6 MB 00:00:01
(6/6): base/7/x86_64/other_db | 2.6 MB 00:00:01
元数据缓存已建立