yum源更新为国内的镜像地址
1)备份系统原文件
[root@moban ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2)下载国内的镜像地址文件
[root@moban ~]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -P /usr/local/src/ --2015-07-04 20:31:59-- http://mirrors.163.com/.help/CentOS6-Base-163.repo Resolving mirrors.163.com... 123.58.173.185, 123.58.173.186 Connecting to mirrors.163.com|123.58.173.185|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2006 (2.0K) [application/octet-stream] Saving to: “/usr/local/src/CentOS6-Base-163.repo” 100%[=========================================================================>] 2,006 --.-K/s in 0s 2015-07-04 20:32:04 (17.4 MB/s) - “/usr/local/src/CentOS6-Base-163.repo” saved [2006/2006]
3)拷贝文件到系统目录下
[root@moban src]# cp CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
4)清除缓存,刷新yum
[root@moban src]# yum clean all Loaded plugins: fastestmirror, security Cleaning repos: base extras updates Cleaning up Everything Cleaning up list of fastest mirrors [root@moban src]# yum makecache Loaded plugins: fastestmirror, security Determining fastest mirrors base | 3.7 kB 00:00 base/group_gz | 216 kB 00:00 base/filelists_db | 6.1 MB 00:06 base/primary_db | 4.6 MB 00:04 base/other_db | 2.8 MB 00:02 extras | 3.4 kB 00:00 extras/filelists_db | 32 kB 00:00 extras/prestodelta | 605 B 00:00 extras/primary_db | 31 kB 00:00 extras/other_db | 37 kB 00:00 updates | 3.4 kB 00:00 updates/filelists_db | 2.6 MB 00:02 updates/prestodelta | 398 kB 00:00 updates/primary_db | 3.9 MB 00:03 updates/other_db | 38 MB 00:38 Metadata Cache Created
转载于:https://blog.51cto.com/maocong/1670960