关注小众语言、AI,记录、分享技术点滴!

0%

设置centos的YUM源为国内阿里云源

1、备份

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 5

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

CentOS 6

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

CentOS 7

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

3、之后运行yum makecache生成缓存

1
2
$ yum clean all
$ yum makecache

完成

ps:
1、同步频率为每天一次,每天凌晨2:00-4:00为镜像的同步时间
2、若使用阿里云服务器,将源的域名从mirrors.aliyun.com改为mirrors.aliyuncs.com,不占用公网流量。