修改centos yum源为国内yum源

2017-12-02  本文已影响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

上一篇 下一篇

猜你喜欢

热点阅读