替换yum源
2020-11-27 本文已影响0人
懒人程序猿
进入镜像源目录
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
清理缓存
yum clean all
重新生成新的缓存
yum makecache
如果没有安装wget,可使用curl替代
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo