问题

安装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. Linux用户组管理及用户权限1

    bash的基础特性:    globbing:文件名通配(整体文件名匹配,而非部分)        匹配模式:元字符            *:匹配任意长度的任意字符                例 ...

  2. JMeter 问题整理

    1. 远程连接出现错误: java.net.connectexception: connection refused: connect -解决办法: 编辑jmeter.bat(windows OS), ...

  3. 配置LANMP环境(6)-- 安装APACHE与PHP配置

    一.安装 Apache 2.4 安装:默认安装2.4版本 yum install httpd 修改配置 vim /etc/httpd/conf/httpd.conf 42行80端口改为 8080查看行 ...

  4. Linux的信号管理

    man 7  signal  #查看信号的实用信息 常用的信号: 信号名     编号       含义SIGHUP    1       无须关闭进程而让其重读配置文件SIGINT      2  ...

  5. HNOI2004 树的计数 和 HNOI2008 明明的烦恼

    树的计数 输入文件第一行是一个正整数n,表示树有n个结点.第二行有n个数,第i个数表示di,即树的第i个结点的度数.其中1<=n<=150,输入数据保证满足条件的树不超过10^17个. 明 ...

  6. PHP swoole UDP服务端和客户端

    服务端 <?php $serv = ,SWOOLE_PROCESS,SWOOLE_SOCK_UDP); $serv->on('Packet',function ($serv,$data,$ ...

  7. Spring 初探(二) AOP 图集

    Spring AOP属于第二代AOP.采用Java作为AOP的实现语言(AOL),采用动态代理机制和字节码生成技术实现. 代理设计模式 ISubject 对被访问者或者被访问资源的抽象,某些场景下不使 ...

  8. git 版本撤销,回退等

    git checkout -- <file>       #丢弃工作区的修改, 不要省略 -- ,这是只在工作区(work tree)修改了内容,还没有add 到暂存区,此时想撤销修改. ...

  9. PHP回顾(面向对象)

    类中的成员属性不能够用函数为其赋值.public age = rand(1,100);//这是错误的: __get()   __set()  __isset() __unset() final 用来修 ...

  10. Dapper源码学习

    序言 资料 https://github.com/StackExchange/Dapper