首先确认机器DNS是否设置正确
vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
1.安装base reop源
cd /etc/yum.repos.d
接着备份旧的配置文件
mv CentOS-Base.repo CentOS-Base.repo.bak
下载阿里源的文件
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2 安装epel repo源:
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
3.清理缓存
yum clean all
4.重新生成缓存
yum makecache
succ!