Centos安装lamp时找不到镜像
Couldn’t resolve host ‘mirrorlist.centos.org’
研究了一下这是报的错:
[root@localhost etc]# yum install httpd
已加载插件:fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os error was
14: curl#6 - “Could not resolve host: mirrorlist.centos.org; 未知的错误”
原因:
dns服务器没有配置正确
解决办法:
1、打开文件/etc/resolv.conf在其中添加:
nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain
2、然后重启网卡:使用命令:
service network restart
问题解决了