安装 centos 之后,修改 yum 源到其它国内源

1. 备份原文件

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

 

2. 下载要切换的 yum 源到本地并命名

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 

3. 重建缓存

yum makecache

 

参考资料:

1. http://mirrors.aliyun.com/help/centos

相关文章:

  • 2021-04-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2021-06-11
猜你喜欢
  • 2021-05-17
  • 2021-08-15
  • 2021-11-30
  • 2021-07-22
  • 2021-04-11
  • 2021-12-01
相关资源
相似解决方案