美文网首页
修改centos yum源为国内yum源

修改centos yum源为国内yum源

作者: 土豆特别想爬山 | 来源:发表于2017-12-02 23:26 被阅读125次

1.把默认yum源备份(可选)

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

2.下载yum源repo文件

阿里云官方教程:http://mirrors.aliyun.com/help/centos

163官方教程:http://mirrors.163.com/.help/centos.html

CentOS5

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

163:wget -O /etc/yum.repos.d/CentOS5-Base-163.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

CentOS6

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

163:wget -O /etc/yum.repos.d/CentOS6-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

CentOS7

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

163:wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3.清除缓存

yum clean all

yum makecache

相关文章

网友评论

      本文标题:修改centos yum源为国内yum源

      本文链接:https://www.haomeiwen.com/subject/rcsobxtx.html