更换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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM