具体错误见截图

刚开始以为是DNS配置错误,经检查发现DNS与物理机的DNS配置是一样的,物理机可以解析DNS

搜索资料发现是/etc/nsswitch.conf这个文件的问题

这个文件hosts标签设置的是host:files

host: files 
表示只用/etc/hosts文件解析主机

修改成hosts:      files dns

hosts: files dns
将使用/etc/inet/hosts文件解析主机,表示如果无法解析主机名将使用DNS。

然后执行service network restart

执行yum成功

环境为

centos执行yum出现Could not retrieve mirrorlist错误的更多相关文章

  1. 解决Centos7 yum 出现could not retrieve mirrorlist 错误

    刚通过VMware12安装了centos7.x后,使用ip addr查看centos局域网的ip发现没有,使用yum安装一些工具包时也出现报错: Loaded plugins: fastestmirr ...

  2. Centos7修改为固定IP后 yum 出现could not retrieve mirrorlist

    Centos7修改为固定IP后 yum 出现could not retrieve mirrorlist,发现yum源的域名无法解析 按照6,修改/etc/resovle.conf,新增域名解析服务器1 ...

  3. CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

    今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: Could not retrieve mirrorlist http://mirrorlist.cen ...

  4. centos报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/

    检查是否可以上网. ping 114.114.114.114 如果不可以,调试通.通了之后下一步: 然后检查DNS设置是否正常. ping www.baidu.com 不正常的话,设置DNS,如下: ...

  5. 7. Centos7 yum 出现could not retrieve mirrorlist 最终解决方案

    Step 1: sudo vi /etc/sysconfig/network-scripts/ifcfg-ens33 Step 2:  将ONBOOT改为yes,wq!保存退出 Step 3:重启ne ...

  6. CentOS系统yum源使用报错:Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge.

    服务器上的yum突然不好使用,使用yum的时候报错如下:[root@bastion-IDC src]# yum list......Could not retrieve mirrorlist http ...

  7. yum 安装报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

    [root@venn09 ~]# yum install -y vim Loaded plugins: fastestmirror Could not retrieve mirrorlist http ...

  8. CentOS----使用yum命令出现“could not retrieve mirrorlist http://mirrorlist.centos.org ***” - ybq155”

    无聊安装了个mini版的32位的CentOS 6.5,进来想安装个东西,yum install emacs 提示什么 Loaded plugins: fastestmirror, refresh-pa ...

  9. CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”

    刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum –y install gcc. 提示如下错误信息: Loaded plugins: fastestmirror, refr ...

随机推荐

  1. QT_地图导航

    //地图显示功能 #ifndef MAPWIDGET_H #define MAPWIDGET_H #include <QGraphicsView> #include <QLabel& ...

  2. squid 2.7 通过域名反向代理多个服务器的配置方法

    详细配置及注释如下,供大家学习参考. visible_hostname squid1.abc.com #设定squid的主机名,如无此项squid将无法启动 http_port 80 accel vh ...

  3. BigDecimal 处理集合

    1  创建一个BigDecimal 对象 BigDecimal Sum = new BigDecimal(0); 2  一个BigDecimal 对象,保留2位小数点 Sum.setScale(2,B ...

  4. llinux常用命令

    (1)Ctrl+alt+(1-6)可调用控制台程序 (2)date---可看时间日期 (3)date 月日时分年 ------可修改时间 (4)useradd-------新建用户 (5)passwd ...

  5. gdb的可视化工具安装

    红帽推出的insight https://www.sourceware.org/insight/index.php http://wiki.ubuntu.org.cn/Insight%E7%9A%84 ...

  6. maven权威指南学习笔记(四)—— maven生命周期(lifecycle)

    定义: 生命周期是包含在一个项目构建中的一系列有序的阶段 举个例子来说就是maven 对一个工程进行: 验证(validate) -- 编译源码(compile) -- 编译测试源码(test-com ...

  7. Mac 显示隐藏文件

    defaults write com.apple.finder AppleShowAllFiles -bool true 此命令显示隐藏文件defaults write com.apple.finde ...

  8. 布局包含Image和Title的UIButton

    UIButton中的titleEdgeInsets和imageEdgeInsets可以管理button中image和title的布局. 如果对其理解不够深入,用纯数字进行布局管理,经过不断的调试,还是 ...

  9. Python爬虫学习(11):Beautiful Soup的使用

    之前我们从网页中提取重要信息主要是通过自己编写正则表达式完成的,但是如果你觉得正则表达式很好写的话,那你估计不是地球人了,而且很容易出问题.下边要介绍的Beautiful Soup就可以帮你简化这些操 ...

  10. 大神的Blog挂了,从Bing快照里复制过来的备份

    UWidget封装SWidget到UMG 2015年8月30日0 为了使用UMG中的一些高级或便利特性,需要将制作好的Slate控件封装到UWidget中去. 当前UE4版本4.8.3. 将Slate ...