更新Linux系统的yum源为国内(阿里)的yum仓库

阿里yum源参考链接如下:

https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11DsXG0k

 

  • 备份原yum配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  • 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

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-6.repo
  •  运行 yum makecache 生成缓存
  • 更新完成,如下图(vim /etc/yum.repos.d/CentOS-Base.repo):

    

 

posted @ 2020-04-05 20:22  后山前堂客  阅读(1591)  评论(0)    收藏  举报