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

CentOS8如何更换yum源

andy2个月前 (03-26)CentOS66

备份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

分享给朋友:

“CentOS8如何更换yum源” 的相关文章

银河麒麟桌面操作系统V10SP1 2403 下载地址

2024年8月9日 更新银河麒麟桌面操作系统V10 SP1 X86-2403 (兆芯/海光)官网下载:https://iso.kylinos.cn/web_pungi/download/cdn/kr2GXJian8qzg4deDwPvtN91QoMZOHSV/Kylin-Desktop-V10-SP...

发表评论

访客

看不清,换一张

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