把linux下的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 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

 

 

3.生成缓存

 yum clean all yum makecache 

posted @ 2017-12-30 10:36  爱奔跑的大卫  阅读(630)  评论(0)    收藏  举报