报错
yum install error
[root@localhost cmake-3.2.2]# yum install gcc
Loaded plugins: fastestmirror, refresh-packagekit, security
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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
[root@localhost cmake-3.2.2]# yum install gcc-c++
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
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
解决方法
修改dns配置
vi /etc/resolv.conf
## 在此文件最后加入:
nameserver 114.114.114.114

本文详细描述了在Linux系统中使用yum安装时遇到的错误,如'Cannot find a valid base URL for repo',重点介绍了如何通过修改DNS配置解决因无法连接到mirrorlist.centos.org导致的问题,包括编辑resolv.conf文件并添加备用DNS服务器114.114.114.114。

1578

被折叠的 条评论
为什么被折叠?



