当前位置:首页 > CentOS > 正文内容

CentOS8如何更换yum源

andy11个月前 (03-26)CentOS336

备份yum源配置

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载阿里云yum源到指定配置文件

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

替换yum源配置文件中相关配置项

cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

清除yum源缓存并重新make缓存

yum clean all
yum makecache


扫描二维码推送至手机访问。

版权声明:本文由电脑帮发布,如需转载请注明出处。

本文链接:http://www.52dnb.com/?id=4

分享给朋友:

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。