CentOs yum 源配置

备份原配置文件

yum 源的配置文件在/etc/yum.repos.d下,修改CentOS-Base.repo的内容
先备份原来的配置文件

 sudo mv CentOS-Base.repo CentOS-Base.repo.backup

下载新的源配置文件

阿里云

  • CentOS7
sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  • CentOS6
sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  • CentOS5
sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

网易

  • CentOS7
sudo wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
  • CentOS6
sudo wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
  • CentOS5
sudo wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

中科大

  • CentOS7
sudo wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=3
  • CentOS6
sudo wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=2
  • CentOS5
sudo wget -O CentOS-Base.repo https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1

更新源数据

  • 先清除原来的源数据缓存
sudo yum clean all
  • 更新源数据缓存
sudo yum makecache
posted @ 2020-12-28 16:23  ℡angel  阅读(594)  评论(0编辑  收藏  举报