(1)打开Centos7,确保有网
ping baidu.com
PING baidu.com (110.242.68.66) 56(84) bytes of data.
64 bytes from 110.242.68.66 (110.242.68.66): icmp_seq=1 ttl=128 time=115 ms
(2)更改配置yum源(确保yuml可以正常下载)
步骤一:将系统本身的yum源移除
查看yum源
[root@ 0.0]# cd /etc/yum.repos.d/
[root@0.0 yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo local.repo
创建备份文件夹将yum全部转移到文件夹中
[root@chengzhenhua yum.repos.d]# mkdir beifen
[root@chengzhenhua yum.repos.d]# mv *.* ./beifen/
[root@chengzhenhua yum.repos.d]# ls
beifen
步骤二:下载阿里yun源
wget按照地址下载阿里yum
[root@chengzhenhua yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 218.98.31.194, 218.98.31.195, 218.98.31.198, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|218.98.31.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’
100%[=============================================================================>] 2,523 --.-K/s in 0s
(188 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]
验证
[root@chengzhenhua yum