系统相关
首页 > 系统相关> > centos 8.5 换源

centos 8.5 换源

作者:互联网

OMG centos8.5 官方不支持了

 

备份原repo:
rename '.repo' '.repo.bak' /etc/yum.repos.d/*.repo
下载最新repo:
wget https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo -O /etc/yum.repos.d/Centos-vault-8.5.2111.repo
wget https://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel-archive-8.repo
替换repo里面关键字:
sed -i 's/mirrors.cloud.aliyuncs.com/url_tmp/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo && sed -i 's/url_tmp/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.aliyun.com/mirrors.cloud.aliyuncs.com/g' /etc/yum.repos.d/epel-archive-8.repo
二次替换关键字:
http://mirrors.cloud.aliyuncs.com需要替换为http://mirrors.aliyun.com,但是官方提供的命令没替换完,如果有执行官方提供的命令还是不行的话执行下面的命令。

sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/Centos-vault-8.5.2111.repo
sed -i 's/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g' /etc/yum.repos.d/epel-archive-8.repo
清空yum原缓存:
yum clean all && yum makecache


————————————————
版权声明:本文为CSDN博主「星河_赵梓宇」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Aria_Miazzy/article/details/125060809

 

标签:8.5,centos,mirrors,repos,repo,etc,换源,yum,com
来源: https://www.cnblogs.com/yiminlin/p/16455608.html