Loading

CentOS切换源到华为云镜像站

更新记录
转载请注明出处:https://www.cnblogs.com/cqpanda/p/16536148.html
2022年8月7日 发布。
2022年8月6日 从笔记迁移到博客。

1.备份配置文件

cp -a /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

2.下载新的CentOS-Base.repo文件到/etc/yum.repos.d/目录下

wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
## 如果是CentOS 8就执行下面这个
wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-8-reg.repo

3.执行yum clean all清除原有yum缓存。

yum clean all

4、执行yum makecache(刷新缓存)

yum makecache
posted @ 2022-08-07 07:57  重庆熊猫  阅读(418)  评论(0编辑  收藏  举报