一、现象
配置在线源时,第一步将在线 YUM 源配置文件下载到本地我就卡住了,如下所示:
[ root@localhost ~]
--2021-02-24 19:25:34-- https://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com ( mirrors.aliyun.com) .. . 失败:未知的名称或服务。
wget: 无法解析主机地址 “mirrors.aliyun.com”
纳闷了,而后我尝试 ping 测试下网络,也是无法成功
[ root@localhost ~]
ping: www.baidu.com: 未知的名称或服务
二、解决
我当时脑袋抽了,想了有一会儿,这就是网络的问题 原来是这样的,我之前在做 Squid 的构建透明代理服务器实验的时候,在网卡配置文件中注释掉了网关(GATEWAY),在这里,本机就相当于网卡服务器 再把注释去掉,重启下网卡,就恢复正常了
[ root@localhost ~]
[ root@localhost ~]
Restarting network ( via systemctl) : [ 确定 ]
[ root@localhost ~]
--2021-02-24 19:36:55-- https://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com ( mirrors.aliyun.com) .. . 58.216.16.43, 61.155.221.223, 222.186.18.242, .. .
正在连接 mirrors.aliyun.com ( mirrors.aliyun.com) | 58.216.16.43| :443.. . 已连接。
已发出 HTTP 请求,正在等待回应.. . 200 OK
长度:2523 ( 2.5K) [ application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”100%[ == == == == == == == == == == == == == == == == == == == == == == = > ] 2,523 --.-K/s 用时 0s 2021-02-24 19:36:56 ( 90.8 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [ 2523/2523] )