更换为阿里源
cd /etc/yum.repos.d
sed -i s@mirrorlist=@#mirrorlist=@g CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo
sed -i s@#baseurl=@baseurl=@g CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo
sed -i s@mirror.centos.org@mirrors.aliyun.com@g CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo
生成缓存
yum clean all && yum makecache
查看可用源
yum repolist enabled