修改CentOS为国内镜像源

admin 2018-3-9 1436

有时候我们在国内的vps常常会出现安装或更新时速度贼慢的情况,或者是软件不存在的情况,所以我们需要更换镜像源!

首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

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

接着更换为国内源

网易:
Centos7: 

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

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

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

 

阿里:
Centos7: 

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

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

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

 

中国科学技术大学:
Centos7:

 wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/ustc/CentOS7-Base.repo
Centos6: 

wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/ustc/CentOS6-Base.repo
Centos5:

 wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/ustc/CentOS5-Base.repo

 

中国清华大学:
Centos7: 

wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/tsinghua/CentOS7-Base.repo
Centos6: 

wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/tsinghua/CentOS6-Base.repo
Centos5: 

wget -O /etc/yum.repos.d/CentOS-Base.repo https://tly.4gml.com/Linux/Centos/Repo/tsinghua/CentOS5-Base.repo

运行以下命令生成缓存

yum clean all
yum makecache


最后于 2018-3-9 被admin编辑 ,原因:
最新回复 (0)
全部楼主
返回
发新帖