问题

安装Centos7(core)以后,网卡默认不会启用。这是一个大坑,直接报错,这是一个过度优化,有几个开发人员/运维人员安装centos7(core)不用ssh去连接服务器的。

报错如下:

Loaded plugins: fastestmirror
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"
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror. One of the configured repositories failed (CentOS-7 - Base),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled
yum --disablerepo=base ... 4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage: yum-config-manager --disable base
or
subscription-manager repos --disable=base 5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise: yum-config-manager --save --setopt=base.skip_if_unavailable=true failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
[root@localhost ~]#

解决办法

1、故障发生以后,第一看看网络是否通畅

ping www.baidu.com

#google dns
ping 8.8.8.8

以上均无反应,于是想起来前一段时间设置过一次centos网卡,让他开机自动启动。命令如下

vi /etc/sysconfig/network-scripts/ifcfg-ens33

修改里面的Boot=yes

Boot=no (开机引导的时候不启动网卡)
#改成yes

启动网卡

ifup ens33

查看ip地址

ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:63:c2:ca brd ff:ff:ff:ff:ff:ff
inet 192.168.152.141/24 brd 192.168.152.255 scope global noprefixroute dynamic ens33
valid_lft 1319sec preferred_lft 1319sec
inet6 fe80::fdb9:c978:ff44:dbc5/64 scope link noprefixroute
valid_lft forever preferred_lft forever

虚拟机ip地址是 192.168.152.141

2、更新本地缓存:

yum makecache

[root@promote ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.njupt.edu.cn
* updates: mirrors.cn99.com
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/8): extras/7/x86_64/other_db | 127 kB 00:00:00
(2/8): extras/7/x86_64/filelists_db | 246 kB 00:00:00
(3/8): updates/7/x86_64/prestodelta | 797 kB 00:00:00
(4/8): updates/7/x86_64/other_db | 641 kB 00:00:00
(5/8): base/7/x86_64/other_db | 2.6 MB 00:00:01
(6/8): base/7/x86_64/filelists_db | 7.1 MB 00:00:02
(7/8): updates/7/x86_64/filelists_db | 4.4 MB 00:00:03
extras/7/x86_64/prestodelta FAILED
http://mirrors.njupt.edu.cn/centos/7.6.1810/extras/x86_64/repodata/5bfd3d5f07606011226e556e87d978ca1dfe51a63e18d793182900d5bbc702b5-prestodelta.xml.gz: [Errno 14] HTTP Error 302 - Found
Trying other mirror.
(8/8): extras/7/x86_64/prestodelta | 65 kB 00:00:00
Metadata Cache Created

Could not resolve host: mirrorlist.centos.org Centos 7 Unkown error的更多相关文章

  1. 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 ...

  2. couldnt resolve host mirrorlist.centos

     解决centos 6.3 yum安装软件时找不到镜像问题 [root@nagios-server ~]# yum update –y Loaded plugins: fastestmirror Lo ...

  3. 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安装命令时报了以下错误: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...

  4. linux安装软件时提示找不到镜像的问题:Couldn't resolve host 'mirrorlist.centos.org'

    问题:[root@cddserver2 ~]# yum -y install gcc-*Loaded plugins: fastestmirror, prestoCould not retrieve ...

  5. linux安装命令出错(could not resolve host mirrorlist.centos.org)

    本次问题出现在虚拟机安装的centos7系统之后,使用yum命令安装wget命令(yum -y install wget),出现could not resolve host mirrorlist.ce ...

  6. CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

    在VBox上安装完CentOS6.5之后,首次使用时yum命令安装软件时,经常遇到"couldn't resolve host 'mirrorlist.centos.org"这个问 ...

  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. yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut

    # yum install -y epel-release Loaded plugins: fastestmirror Repository base is listed more than once ...

  9. yum命令安装软件时,出现--centos 7 安装apache 出现 Could not resolve host: mirrorlist.centos.org; 未知的错误"--CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决

    CentOS网络设置 couldn't resolve host 'mirrorlist.centos.org问题解决 今天在虚拟机上安装完CentOS6.5之后,首次使用时yum命令安装软件时,出现 ...

  10. 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

    14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured ...

随机推荐

  1. c++分布式服务框架teamtalk

    这是蘑菇街开发的内部通讯软件,记录一下.可以参考学习 https://github.com/meili/TeamTalk

  2. js抽奖,跑马灯

    分享自己写的跑马灯抽奖. HTML代码 <!--首先将一个div的背景设为一个圆形--> <div style=" width:240px; height:232px; b ...

  3. 第二章 Vue快速入门--13 讲解v-model实现表单元素的数据双向绑定

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  4. 经常使用的js三元表达式

    语法:条件?表达式1:表达式2 .  条件的括号可要可不要的 let istrue = true; let a = (istrue === true) ? '我是true啊' : "我是fa ...

  5. xml配置文件 操作

    public class ConfigFile { protected readonly string configBasePath = "Root/Config"; /// &l ...

  6. 《剑指offer》算法题第五天

    今日题目: 反转链表 合并两个排序的链表 树的子结构 二叉树的镜像 对称二叉树 今日重点是1反转链表,3树的子结构,以及5对称二叉树. 1. 反转链表 题目描述: 输入一个链表,反转链表后,输出链表的 ...

  7. flask框架(三):flask配置文件

    flask中的配置文件是一个flask.config.Config对象(继承字典),默认配置为: { 'DEBUG': get_debug_flag(default=False), 是否开启Debug ...

  8. 十八、MySQL 数据排名查询某条数据是总数据的第几条

    ) as rowno )) b ORDER BY a.zjf DESC 注意:mysql的下标是从0开始的 参考文章: https://blog.csdn.net/warylee/article/de ...

  9. ERROR: virtualenvwrapper could not find virtualenv in your path

    环境: Ubuntu 18.04 Python3 使用pip3安装virtualenv和virtualenvwrapper两个包,ubuntu18.04中,用户使用pip安装的包在~/.local/下 ...

  10. Centos 7.6 安装Mysql5.7(离线)

    Centos 7.6 安装Mysql5.7(离线) 标签(空格分隔): mysql 安装包下载 https://dev.mysql.com/downloads/mysql/ [image.png-14 ...