Could not resolve host: mirrorlist.centos.org Centos 7 Unkown error

安装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"
[[email protected] ~]# 

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

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

更新本地缓存:

yum makecache

[[email protected] ~]# 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

原文地址:https://www.cnblogs.com/passedbylove/p/11105988.html

时间: 2024-10-12 05:11:21

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

解决Couldn&#39;t resolve host &#39;mirrorlist.centos.org

这个错误引起主要是因为环境读取不到yun引起的可以考虑/etc/sysconfig/network-scripts/ifcfg-eth0 配置出错导致网络不通.或者/etc/resolv.conf的DNS配置出错.或者可以考虑清楚yum缓存影响(yum clean all) (下面是网上找到比较有用资料) 今天在linux环境通过yum安装软件报了以下错误: [[email protected] yum.repos.d]# yum install ncurses devel -y Loaded 

Couldn&#39;t resolve host &#39;mirrorlist.centos.org&#39;解决办法

今天在服务器上安装oneinstack时, 输入命令: wget http://mirrors.linuxeye.com/oneinstack-full.tar.gz 出现: Couldn't resolve host 'mirrorlist.centos.org' 无法解析 解决方法: [[email protected] ~]# vim /etc/resolv.conf nameserver 8.8.8.8 就好了. 不要怕问题,所有的问题,都是让你收获答案来的. ----------  招

[原]linux安装软件时提示找不到镜像的问题:Couldn&#39;t resolve host &#39;mirrorlist.centos.org&#39;

问题:[[email protected] ~]# yum -y install gcc-*Loaded plugins: fastestmirror, prestoCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.cent

PYCURL ERROR 6 - “Couldn&#39;t resolve host &#39;mirrorlist.centos.org&#39;”

在虚拟机上安装的CentOS,估计是网络配置问题,导致yum update和yum install之类的功能的用不了.出现标题上面的错误. ifdown [network_adapter] ifup [network_adapter] yum update 尝试以上命令就可以解决了. reference:http://stackoverflow.com/questions/20816133/pycurl-error-6-couldnt-resolve-host-mirrorlist-centos

CentOS网络设置 couldn&#39;t resolve host &#39;mirrorlist.centos.org问题解决

今天在虚拟机上安装完CentOS6.5之后,首次使用时yum命令安装软件时,出现一堆的"couldn't resolve host 'mirrorlist.centos.org"这个问题. 上网上查了半天,很多都说在/etc/resolv.conf文件末尾添加下边这几段 [plain] view plain copy nameserver 8.8.8.8 nameserver 8.8.4.4 serchdomain localdomain ...布拉布拉布拉...如是云云... 可我试

【转】解决yum安装软件报Couldn&#39;t resolve host &#39;mirrorlist.centos.org问题

转自:http://blog.51cto.com/oldcat1981/1719825 今天在linux环境通过yum安装软件报了以下错误: [[email protected] yum.repos.d]# yum install ncurses devel -y Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http

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

本次问题出现在虚拟机安装的centos7系统之后,使用yum命令安装wget命令(yum -y install wget),出现could not resolve host mirrorlist.centos.org,看到一篇文章回答的不错 首先看看虚拟机是否有网络连接,尝试ping一下本地ip,如果ping的时候直接出现network is unreachable,那么说明虚拟机网络配置有问题, 打开:/etc/resolv.conf文件,配置DNS:这里根据系统配置,有的是8.8.8.8,这

解决 &quot;Could not resolve host: mirrorlist.centos.or

解决 "Could not resolve host: mirrorlist.centos.org; 未知的错误" 安装yum报以下错误:错误引起主要是因为环境读取不到yun引起的.可以考虑/etc/sysconfig/network-scripts/ifcfg-eth0 配置出错导致网络不通.或者/etc/resolv.conf的DNS配置出错.或者可以考虑清楚yum缓存影响(yum clean all)经过尝试之后,以下步骤解决了我的问题:vi /etc/resolv.conf n

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

问题:[[email protected] ~]# yum -y install gcc-*Loaded plugins: fastestmirror, prestoCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.cent

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

14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured repositories failed (未知), 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 t