• 欢迎访问水熊虫网站,这里是我个人的工作博客,内容大多是遇到问题完善后,会在这里进行总结归纳内容! QQ群
  • 网站导航中的友情链接专栏上线,更新的都是自己这三年整理的一些东西,感兴趣可以看看!
  • 你所浪费的今天,是昨天死去的人奢望的明天。你所厌恶的现在,是未来的你回不去的曾经!

Centos的yum源更换为国内的阿里云软件源

云主机问题 WaterBear 6年前 (2017-11-02) 941次浏览 已收录 扫描二维码

Ubuntu更换阿里云软件源 链接 https://waterbear.pw/1956.html


Centos的yum源更换为国内的阿里云源 

 1、备份 

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

 2、下载新的CentOS-Base.repo 到/etc/yum.repos.d/ 

 CentOS

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

或者

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

CentOS 6 

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

或者

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

CentOS 7 

 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

CentOS 8 

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

或者

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

3、清除原有缓存

yum clean all
或者
rm -rf /var/cache/yum/*

4、获取更新yum列表

yum makecache

或者

 dnf makecache(Fedora从22版本、CentOS从8版本弃用yum换成dnf,yum命令还可以用,只是每次使用系统都会提醒换成dnf)

相关链接
官方主页: http://www.centos.org/
邮件列表: http://www.centos.org/modules/tinycontent/index.php?id=16
论坛: http://www.centos.org/modules/newbb/
文档: http://www.centos.org/docs/
Wiki: http://wiki.centos.org


WaterBear , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Centos的yum源更换为国内的阿里云软件源
喜欢 (2)
[[email protected]]
分享 (0)