yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

时间:2023-03-09 03:42:36
yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

今天在虚拟机上安装完CentOS6.5之后,首次使用时yum命令安装软件时,出现一堆的”couldn't resolve host 'mirrorlist.centos.org”这个问题。

上网上查了半天,很多都说在/etc/resolv.conf文件末尾添加下边这几段

  1. nameserver 8.8.8.8
  2. nameserver 8.8.4.4
  3. serchdomain localdomain

可我试了根本就没有用!才发现网上99.9%的人都是人云亦云的抄来的,根本就没说到点子上。其实这个问题根本原因就是你的CentOS不能连接网络造成的。。。

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

你要问我为什么是“百度”?我只能回答:百度当然是用来测试网络通不通用的。。。

好吧言归正传。我也是醉了。。。最近弄虚拟机都是搞得固定IP小局域网的模式,根本上不了外网。我竟然忘了!!

最后果断切换虚机网卡配置,链接上外网:

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

然后再用yum命令更新。。。果断好使了。。。

yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

原文链接:http://blog.csdn.net/budory/article/details/49513473