CentOS7默认的yum源更换为阿里云源


 

[root@centos02 yum.repos.d]# cd /etc/yum.repos.d
[root@centos02 yum.repos.d]# ll
总用量 32
-rw-r--r--. 1 root root 1664 4月  29 00:35 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 4月  29 00:35 CentOS-CR.repo
-rw-r--r--. 1 root root  649 4月  29 00:35 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 4月  29 00:35 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 4月  29 00:35 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 4月  29 00:35 CentOS-Sources.repo
-rw-r--r--. 1 root root 4768 4月  29 00:35 CentOS-Vault.repo
[root@centos02 yum.repos.d]# 
[root@centos02 yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 
[root@centos02 yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2018-08-13 01:08:28--  http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 121.9.229.239, 121.9.229.123, 121.9.229.238, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|121.9.229.239|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

100%[======================================>] 2,523       --.-K/s 用时 0s      

2018-08-13 01:08:28 (634 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])

[root@centos02 yum.repos.d]# [root
@centos02 yum.repos.d]# yum clean all 已加载插件:fastestmirror, langpacks 正在清理软件源: base extras updates Cleaning up everything Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos Cleaning up list of fastest mirrors
[root@centos02 yum.repos.d]# [root
@centos02 yum.repos.d]# yum makecache 已加载插件:fastestmirror, langpacks Determining fastest mirrors * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com 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 30004 milliseconds') 正在尝试其它镜像。 http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; 未知的错误" 正在尝试其它镜像。 base | 3.6 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 (1/12): base/7/x86_64/group_gz | 166 kB 00:00 (2/12): base/7/x86_64/primary_db | 5.9 MB 00:00:24 (3/12): base/7/x86_64/filelists_db | 6.9 MB 00:00:28 (4/12): extras/7/x86_64/filelists_db | 588 kB 00:00:03 (5/12): extras/7/x86_64/primary_db | 173 kB 00:00:01 (6/12): extras/7/x86_64/other_db | 110 kB 00:00:00 (7/12): extras/7/x86_64/prestodelta | 68 kB 00:00:06 (8/12): updates/7/x86_64/prestodelta | 409 kB 00:00:03 (9/12): base/7/x86_64/other_db | 2.5 MB 00:00:14 (10/12): updates/7/x86_64/filelists_db | 2.4 MB 00:00:17 (11/12): updates/7/x86_64/other_db | 381 kB 00:00:09 (12/12): updates/7/x86_64/primary_db | 4.3 MB 00:00:27 元数据缓存已建立 [root@centos02 yum.repos.d]#
[root
@centos02 yum.repos.d]# yum repolist 已加载插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com 源标识 源名称 状态 base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 9,911 extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 369 updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 1,041 repolist: 11,321 [root@centos02 yum.repos.d]#

 


免责声明!

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



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