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

After installation Centos7 (core), the card not enabled by default. This is a pit, direct error, this is an over-optimization , there are a few developers / operation and maintenance personnel to install centos7 (core) without ssh to connect to the server.

Given as follows:

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 ~]# 

After the failure, the first to see the network is unobstructed

www.baidu the ping. COM

 # Google dns 
the ping 8.8.8.8

There was no more reaction, so think of it some time ago set once centos network card, so that he at startup. The following command

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

Modify the inside of the Boot = yes

The Boot = NO (do not start when the boot boot NIC) 
# change yes

Start card

ifup ens33

Check ip address

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

Virtual machine ip address is 192.168.152.141

 

Update the local cache:

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

 

Guess you like

Origin www.cnblogs.com/passedbylove/p/11105988.html