yum出现Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile解决方法

yum出现Could not retrieve mirrorlist解决方法

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=i386&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base

  • 1

在centos中使用yum安装软件时可能出现Could not retrieve mirrorlist,这种情况一般是网络出现问题。

方法/步骤

 
  1. 如果配置的DHCP动态网络,则在/etc/resolv.conf文件中添加

    nameserver 8.8.8.8

     
  2. 如果是静态网络,则在/etc/sysconfig/network-scripts/ifcfg-eth0文件中添加

    DNS1=8.8.8.8

     

  3. 3

    然后重启网络服务,

    service network restart

     https://jingyan.baidu.com/article/6c67b1d6f492d62786bb1e45.html
posted @ 2019-03-08 13:57  寂静生长  阅读(64355)  评论(3编辑  收藏  举报
/* 看板娘 */ /* */