1:验证网路是否可以连接阿里云镜像
ping mirrors.aliyun.com
2:下载阿里;云centos-7.repo文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3:清除及生成缓存
yum clean all
yum makecache
删除原yum源
rm -rf /etc/yum.repos.d/*
下载阿里云Centos -7.repo文件
cul -o /etc/yum.repos.d/CentOS- Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清除yum缓存
yum clean all
缓存阿里云镜像
yum mokecache