Centos 7 替换镜像源

1 备份原始源

[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2 下载新的镜像源

3 更新缓存

[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, langpacks
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30000 milliseconds')
正在尝试其它镜像。
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/5): extras/7/x86_64/prestodelta | 102 kB 00:00:01
(2/5): extras/7/x86_64/other_db | 108 kB 00:00:00
(3/5): extras/7/x86_64/filelists_db | 636 kB 00:00:01
(4/5): base/7/x86_64/other_db | 2.5 MB 00:00:02
(5/5): base/7/x86_64/filelists_db | 6.7 MB 00:00:02
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
元数据缓存已建立

猜你喜欢

转载自www.cnblogs.com/hzw97/p/11757288.html