centos系统更换系统yum源为阿里云源

最后更新于 2024-10-24 544 次阅读


目前centos系统已经停止维护了,所以官方的yum源已经失效了,目前想要正常使用的话需要,需要将官方的yum源切换为阿里云或腾讯云。所以特在此记录一下更换方法。

#备份官方yum源信息 
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 

#下载阿里云的yum源并重命名为CentOS-Base.repo 
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

#清除yum缓存 
yum clean all 

#重建yum缓存 
yum makecache