问题

安装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. Hive优化(十一)

    Hive优化 ​ Hive的存储层依托于HDFS,Hive的计算层依托于MapReduce,一般Hive的执行效率主要取决于SQL语句的执行效率,因此,Hive的优化的核心思想是MapReduce的优 ...

  2. ios系统保存校园网密码

    相信ios用户每次登陆时无法保存必须要重新输入账号密码的问题困扰了很多同学,特别是苹果5用户(不要问为什么,屏幕本来就小) 现在我们就一起想办法来解决它吧! 首先,我们进入设置->Safari浏 ...

  3. 将本地代码使用Git上传更新至Github

    注册.配置git 1. 首先注册git image 2.然后下载.配置git 百度“git下载”,然后默认安装,注意的是最后要添加环境变量,最后安装结果如下: image 配置如下: 1.设置本地的s ...

  4. 初始Ajax学习笔记

    前端: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <!--引入 ...

  5. MariaDB安装与使用

    下载地址:https://downloads.mariadb.org/ 下载相对应的电脑版本程序 等待下载完成...... 安装教程: 双击运行 设置数据库的密码 等待安装完成.. 这样就完成安装了. ...

  6. Hadoop-No.8之时间戳

    要获得良好的HBase的模式设计,要正确的理解和使用时间错.在HBase中,时间戳的作用如下所述. 时间戳决定了在put请求修改记录时那些记录更新 时间戳决定了一条记录的多个版本在返回时的排序 时间戳 ...

  7. “我”这个字的unicode码到底是25105

    “我”这个字的unicode码到底是25105 “我”这个字的unicode码到底是25105 “我”这个字的unicode码到底是25105

  8. net core 简单读取json配置文件

    //添加 json 文件路径 var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()) ...

  9. jmeter常见问题小结

    1,报500,查看信息头中的Content-Type 2,https的端口号是443 3,同一个线程组中,不同请求分别用到的字段都可以直接写在‘HTTP信息头管理器’中 4,Debug Sampler ...

  10. (70)一篇文章带你熟悉 TCP/IP 协议

    作者:涤生_Woo链接:http://www.jianshu.com/p/9f3e879a4c9c來源:简书著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 同样的,本文篇幅也比较 ...