CentOS安装阿里云的源 - CentOS源国内最佳实践

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chwshuang/article/details/64922945

CentOS安装阿里云的源 - CentOS源国内最佳实践

一、备份源

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

二、获取新源(Centos-6)

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

各版本对应地址:

CentOS 5
wget -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
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

当然,还有其他源

中科大源
http://mirrors.ustc.edu.cn/centos
网易源
http://mirrors.163.com/centos/
搜狐源
http://mirrors.sohu.com/centos/

不过我要告诉大家,除了阿里云的源,对外开放是1G的带宽,其他源基本上对外也就几M或者十几M,所以,除非是网易或者搜狐内部,我就不说了!

三、更新源缓存

清除历史数据

yum clean all

更新最新缓存

yum makecache

猜你喜欢

转载自blog.csdn.net/chwshuang/article/details/64922945