更换CentOS7的下载源为阿里云

一、安装epel安装

epel是个好东西,不过国外的速度实在是不能忍受。所以 有了这篇文章。

1、 首先卸载以前装的epel以免影响

rpm -e epel-release

2、 下载阿里提供的epel

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

3、yum clean all

4、yum makecache

好了,现在你要装epel源的软件的时候 不再慢吞吞了。

或者直接安装

rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm 

二、Centos光盘的库 

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

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

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

参考:

http://mirrors.aliyun.com/help/centos

posted @ 2016-06-28 00:56  arun_yh  阅读(2488)  评论(0编辑  收藏  举报