CentOS 7在执行yum操作时 报错

CentOS 7在执行yum操作时,

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

14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

 

经过查阅资料,得知这个错误是因为没有配置/etc/resolv.conf。

 

解决方法:

vi /etc/resolv.conf

nameserver 8.8.8.8

search localdomain

 

:wq保存退出即可,之后再执行yum操作,成功!
---------------------

原文:https://blog.csdn.net/a791123503/article/details/77823498?utm_source=copy

posted @ 2018-10-14 00:07  yzl050819  阅读(336)  评论(0编辑  收藏  举报