centOs7上用yum安装软件报错

提示报错信息:


Could not retrieve mirrorlisthttp://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was

14: PYCURL ERROR 6 - "Couldn't resolvehost 'mirrorlist.centos.org'"

Could not retrieve mirrorlisthttp://mirrorlist.centos.org/?release=6&arch=x86_64&repo=extras errorwas

14: PYCURL ERROR 6 - "Couldn't resolvehost 'mirrorlist.centos.org'"

Could not retrieve mirrorlisthttp://mirrorlist.centos.org/?release=6&arch=x86_64&repo=updates errorwas

14: PYCURL ERROR 6 - "Couldn't resolvehost 'mirrorlist.centos.org'"

http://mirrors.163.com/centos/6.2/os/x86_64/repodata/repomd.xml:[Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'"

Trying other mirror.

Error: Cannot retrieve repository metadata(repomd.xml) for repository: base. Please verify its path and try again

[root@hbase01-222 ~]# service iptables stop

[root@hbase01-222 ~]# nslookup  mirrorlist.centos.org

;; connection timed out; no servers couldbe reached



解决办法:

修改一下dns,找到/etc/sysconfig/network-scripts/ifcfg-eno33(后面的数字是随机产生的)

将ONBOOT=no改成yes

然后重启网络 service network restart



参考:https://yq.aliyun.com/ziliao/33477

猜你喜欢

转载自blog.csdn.net/weixin_36104843/article/details/80252422