lee 1235 0 2017-01-15 11:09:16

文章位置:左搜> 编程技术> 正文
1.备份已有的源
#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载阿里yum源
#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
下载中...
--2017-01-15 10:52:45--  http://mirrors.aliyun.com/repo/Centos-6.repo
Resolving mirrors.aliyun.com... 112.124.140.210, 115.28.122.210
Connecting to mirrors.aliyun.com|112.124.140.210|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2572 (2.5K) [application/octet-stream]
Saving to: `/etc/yum.repos.d/CentOS-Base.repo'

100%[====================================================================================================================================================================================================================================>] 2,572       --.-K/s   in 0s      

2017-01-15 10:52:45 (226 MB/s) - `/etc/yum.repos.d/CentOS-Base.repo' saved [2572/2572]
3.刷新yum市场资源
#yum clean all
[root@VM_66_92_centos ~]# yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: base epel extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors

资源更新
 #yum makecache

这里会下载一些资源..需要点时间

更新完成后变完成yum源的切换
注意
所有操作都需要root权限



 
编程技术