查看是否安装 wget
rpm -qa | grep wget
如果没有安装
yum install -y wget
换源
#关闭进程
pkill -9 yum
#备份源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#wget 通过http安装新的阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#清除缓存
yum clean allyum makecacheyum update