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

转载于:https://www.cnblogs.com/yzl050819/p/9784894.html

你可能感兴趣的:(运维,git)