解决Centos7 yum 出现could not retrieve mirrorlist 错误
刚通过VMware12安装了centos7.x后,使用ip addr查看centos局域网的ip发现没有,使用yum安装一些工具包时也出现报错:
Loaded plugins: fastestmirror, refresh-packagekit, 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
使用yum无法检索到镜像列表,解决方法如下。
1. cd /etc/sysconfig/network-scripts 进入该文件夹后,然后再ls一下,查看是否有ifcfg-ens33,有时是ifcfg-eth0
2. vi ifcfg-ens33 进入VI的一般模式,移动光标到ONBOOT=no
3. 按下"i"进入VI的编辑模式,把no删除改为yes
4. 修改后按下esc再次进入一般模式,再按下":"到文件底部,在“:”后输入 “wq” (保存退出)
5. 重启一下centos,再次试一下ip addr和 yum, 就可以了。
附加: 如果在network-scripts里找到的是ifcfg-eth0文件,那就把以下两项改成如下,最后重启就行。
ONBOOT=yes MM_CONTROLLED=no
有问题在下面公众号留言

解决Centos7 yum 出现could not retrieve mirrorlist 错误的更多相关文章
- 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 ...
- centos执行yum出现Could not retrieve mirrorlist错误
具体错误见截图 刚开始以为是DNS配置错误,经检查发现DNS与物理机的DNS配置是一样的,物理机可以解析DNS 搜索资料发现是/etc/nsswitch.conf这个文件的问题 这个文件hosts标签 ...
- Centos7修改为固定IP后 yum 出现could not retrieve mirrorlist
Centos7修改为固定IP后 yum 出现could not retrieve mirrorlist,发现yum源的域名无法解析 按照6,修改/etc/resovle.conf,新增域名解析服务器1 ...
- [CentOS7] minimal安装后 出现 没有ifconfig 无法ping 无法yum could not retrieve mirrorlist http://mirrorlist.centos.org/
刚以minimal方式安装完CentOS,打算看下ip,结果ifconfig没找到(后来得知可以用ip addr查看本机ip) 于是yum grouplist, 结果出现could not retri ...
- CentOS yum有时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置
国内服务器在运行命令yum -y install wget的时候,出现: Could not retrieve mirrorlist http://mirrorlist.centos.org/?rel ...
- CentOS----使用yum命令出现“could not retrieve mirrorlist http://mirrorlist.centos.org ***” - ybq155”
无聊安装了个mini版的32位的CentOS 6.5,进来想安装个东西,yum install emacs 提示什么 Loaded plugins: fastestmirror, refresh-pa ...
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”
刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum –y install gcc. 提示如下错误信息: Loaded plugins: fastestmirror, refr ...
- 【转】CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”
源自:http://www.cnblogs.com/yangbingqi/p/3328610.html 刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum grouplist ...
- CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org
CentOS 使用yum命令安装出现错误提示"could not retrieve mirrorlist http://mirrorlist.centos.org这个错误, 在网上找了好多, ...
随机推荐
- 主流数据库连接池性能比较 hikari druid c3p0 dbcp jdbc
背景 对现有的数据库连接池做调研对比,综合性能,可靠性,稳定性,扩展性等因素选出推荐出最优的数据库连接池 . NOTE: 本文所有测试均是MySQL库 测试结论 1:性能方面 hikariCP> ...
- [Swift]LeetCode119. 杨辉三角 II | Pascal's Triangle II
Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note t ...
- Python内置函数(13)——complex
英文文档: class complex([real[, imag]]) Return a complex number with the value real + imag*1j or convert ...
- Python内置函数(64)——tuple
英文文档: The constructor builds a tuple whose items are the same and in the same order as iterable‘s it ...
- JVM基础系列第10讲:垃圾回收的几种类型
我们经常会听到许多垃圾回收的术语,例如:Minor GC.Major GC.Young GC.Old GC.Full GC.Stop-The-World 等.但这些 GC 术语到底指的是什么,它们之间 ...
- 死磕 java集合之ArrayList源码分析
欢迎关注我的公众号"彤哥读源码",查看更多源码系列文章, 与彤哥一起畅游源码的海洋. 简介 ArrayList是一种以数组实现的List,与数组相比,它具有动态扩展的能力,因此也可 ...
- IIS连接数据库:数据库连接出错,请检查连接字串
搞了一早上,在网上看了各种回答,比如:C盘下的Temp文件夹权限.CONN.asp中的数据库路径问题,都不通.最后发现是: 如果使用的是64位系统,原因有可能是没有64位Access连接驱动. 所以解 ...
- 『Tarjan算法 无向图的双联通分量』
无向图的双连通分量 定义:若一张无向连通图不存在割点,则称它为"点双连通图".若一张无向连通图不存在割边,则称它为"边双连通图". 无向图图的极大点双连通子图被 ...
- mongodb~mapreduce的实现特殊逻辑的统计
map reduce的解释 这是一张来自mongodb-mapreduce图示,比较能说明问题
- leetcode — merge-sorted-array
import java.util.Arrays; /** * Source : https://oj.leetcode.com/problems/merge-sorted-array/ * * * G ...