利用阿里云提供的镜像快速更换本地的yum源

  打开网页:http://mirrors.aliyun.com/

  从“

文件列表

”找到自己的系统:

 

 

MirrorLast updateHelp
CPAN 2015-07-15 15:36:50  
CRAN 2015-07-16 05:11:52  
CTAN 2015-07-12 03:51:20  
apache 2015-07-16 02:06:40  
archlinux 2015-07-16 00:51:24 help
centos 2015-07-16 06:20:51 help
cygwin 2015-07-16 02:00:05 help
debian 2015-07-16 08:07:31 help
debian-backports 2015-07-16 08:50:04 help
debian-cd 2015-07-15 01:05:05  
debian-security 2015-07-16 08:30:55 help
deepin 2015-07-16 03:00:06 help
dotdeb 2015-07-16 01:52:20 help
epel 2015-07-16 07:18:55 help
fedora 2015-07-15 02:24:48 help
freebsd 2015-07-16 03:44:27 help
gentoo 2015-07-14 00:42:09 help
gentoo-portage 2015-07-16 04:04:06 help
gentoo-portage-prefix 2015-01-28 06:09:50  
kali 2015-06-26 03:50:35  
kali-security 2015-06-26 02:22:01  
linux-kernel 2015-07-16 04:06:53  
macports 2015-07-15 03:02:24  
mariadb 2015-07-15 15:32:35  
mongodb 2015-07-16 02:35:57  
oldubuntu-releases 2015-07-16 02:30:08  
opensuse 2015-07-15 13:29:03 help
packman 2015-06-03 02:26:11 help
pypi 2015-07-16 02:49:37 help
raspbian 2015-07-15 02:59:32 help
rpmfusion 2015-07-16 07:22:45  
rubygems 2015-07-15 03:08:28 help
sabayonlinux 2015-07-14 01:04:50  
scientificlinux 2015-07-15 12:20:55 help
ubuntu 2015-07-16 07:00:23 help
ubuntu-releases 2015-07-16 02:24:21  
zabbix 2015-07-16 02:40:05

 

 

 

单击help进入(如我这里当今centos 的help):

 

 

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生成缓存

 

 

 

根据上述的描述操作即可快速完成yum源更换。

posted @ 2017-03-03 15:31  遥望星空  阅读(1719)  评论(0编辑  收藏  举报