CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置

来源:互联网 发布:clock算法 编辑:程序博客网 时间:2024/06/08 14:37

国内服务器在运行命令yum -y install wget的时候,出现:

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。

解决方法:编辑resolv.conf文件,添加:

[plain] view plain copy
  1. nameserver 8.8.8.8  
保存退出即可
阅读全文
0 0