解决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这个错误, 在网上找了好多, ...
随机推荐
- 升讯威微信营销系统开发实践:微信接口的 .NET 封装
GitHub:https://github.com/iccb1013/Sheng.WeixinConstruction因为个人精力时间有限,不会再对现有代码进行更新维护,不过微信接口比较稳定,经测试至 ...
- Windows多线程中关键段(Critical Section)的应用
先看如下代码:(用Visual Studio 2010按照Win32 Console程序创建向导创建) #include "stdafx.h" #include <proce ...
- 【转载】CSS3 文字溶解效果
代码如下: <!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <ti ...
- [Swift]LeetCode168. Excel表列名称 | Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet. For exa ...
- [Swift]LeetCode357. 计算各个位数不同的数字个数 | Count Numbers with Unique Digits
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...
- [Swift]LeetCode486. 预测赢家 | Predict the Winner
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from eith ...
- linux下crontab的使用
在LINUX中,周期执行的任务一般由cron这个守护进程来处理[ps -ef|grep cron].cron读取一个或多个配置文件,这些配置文件中包含了命令行及其调用时间.cron的配置文件称为“cr ...
- [Reversing.kr] Easy Crack Writeup
题目:http://reversing.kr/ Easy Crack IDA打开.分析可知Sub_401080是关键函数.F5后. 当满足 则跳转成功.拼接后得到flag flag: Ea5yR3ve ...
- hadoop分布式搭建
1.新建三台机器,分别为: hadoop分布式搭建至少需要三台机器: master extension1 extension2 本文利用在VMware Workstation下安装Linux cent ...
- Python内置函数(32)——input
英文文档: input([prompt]) If the prompt argument is present, it is written to standard output without a ...