호스트를 확인할 수 없습니다 : mirrorlist.centos.org Centos 7

최신 centos 7을 새로 설치했습니다.

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@localhost ~]#

나는 무언가를 설치하고 싶었고 wget이 설치되지 않았기 때문에 wget을 설치하려고 할 때 yum이 오류를 일으키는 것을 보았습니다.

인터넷 에서이 문제에 대한 모든 주제를 보았지만 운이 없어 내 솔루션을 찾을 수 없습니다.

[root@localhost ~]# yum update
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 ~]#

그래서 repos를 나열하면이를 얻습니다.

[root@localhost ~]# yum repolist all
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.
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.
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
http://mirror.centos.org/centos/7/centosplus/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
http://mirror.centos.org/centos/7/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
http://mirror.centos.org/centos/7/updates/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.
repo id                                                                                         repo name                                                                                         status
C7.0.1406-base/x86_64                                                                           CentOS-7.0.1406 - Base                                                                            disabled
C7.0.1406-centosplus/x86_64                                                                     CentOS-7.0.1406 - CentOSPlus                                                                      disabled
C7.0.1406-extras/x86_64                                                                         CentOS-7.0.1406 - Extras                                                                          disabled
C7.0.1406-fasttrack/x86_64                                                                      CentOS-7.0.1406 - CentOSPlus                                                                      disabled
C7.0.1406-updates/x86_64                                                                        CentOS-7.0.1406 - Updates                                                                         disabled
C7.1.1503-base/x86_64                                                                           CentOS-7.1.1503 - Base                                                                            disabled
C7.1.1503-centosplus/x86_64                                                                     CentOS-7.1.1503 - CentOSPlus                                                                      disabled
C7.1.1503-extras/x86_64                                                                         CentOS-7.1.1503 - Extras                                                                          disabled
C7.1.1503-fasttrack/x86_64                                                                      CentOS-7.1.1503 - CentOSPlus                                                                      disabled
C7.1.1503-updates/x86_64                                                                        CentOS-7.1.1503 - Updates                                                                         disabled
C7.2.1511-base/x86_64                                                                           CentOS-7.2.1511 - Base                                                                            disabled
C7.2.1511-centosplus/x86_64                                                                     CentOS-7.2.1511 - CentOSPlus                                                                      disabled
C7.2.1511-extras/x86_64                                                                         CentOS-7.2.1511 - Extras                                                                          disabled
C7.2.1511-fasttrack/x86_64                                                                      CentOS-7.2.1511 - CentOSPlus                                                                      disabled
C7.2.1511-updates/x86_64                                                                        CentOS-7.2.1511 - Updates                                                                         disabled
C7.3.1611-base/x86_64                                                                           CentOS-7.3.1611 - Base                                                                            disabled
C7.3.1611-centosplus/x86_64                                                                     CentOS-7.3.1611 - CentOSPlus                                                                      disabled
C7.3.1611-extras/x86_64                                                                         CentOS-7.3.1611 - Extras                                                                          disabled
C7.3.1611-fasttrack/x86_64                                                                      CentOS-7.3.1611 - CentOSPlus                                                                      disabled
C7.3.1611-updates/x86_64                                                                        CentOS-7.3.1611 - Updates                                                                         disabled
base/7/x86_64                                                                                   CentOS-7 - Base                                                                                   enabled: 0
base-debuginfo/x86_64                                                                           CentOS-7 - Debuginfo                                                                              disabled
base-source/7                                                                                   CentOS-7 - Base Sources                                                                           disabled
c7-media                                                                                        CentOS-7 - Media                                                                                  disabled
centosplus/7/x86_64                                                                             CentOS-7 - Plus                                                                                   enabled: 0
centosplus-source/7                                                                             CentOS-7 - Plus Sources                                                                           disabled
cr/7/x86_64                                                                                     CentOS-7 - cr                                                                                     disabled
extras/7/x86_64                                                                                 CentOS-7 - Extras                                                                                 enabled: 0
extras-source/7                                                                                 CentOS-7 - Extras Sources                                                                         disabled
fasttrack/7/x86_64                                                                              CentOS-7 - fasttrack                                                                              disabled
updates/7/x86_64                                                                                CentOS-7 - Updates                                                                                enabled: 0
updates-source/7                                                                                CentOS-7 - Updates Sources                                                                        disabled
repolist: 0
[root@localhost ~]#

내 vmware / OVH 전용 서버에서 새로 설치할 때 문제가 될 수있는 부분이 확실하지 않습니다.

다른 서버가 설치되어 있고 제대로 작동하지만 이번에는이 문제가 발생했습니다.

etc / yum.repo.d에서 모든 비활성화 된 라인을 활성화하려고했습니다.

내 /etc/yum.repos.d/CentOS-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


답변

Could not resolve host: mirrorlist.centos.org; Unknown error

이는 (a) DNS 서버가 올바르게 구성되어 있지 않거나 (b) 네트워크 구성이 올바르지 않고 DNS 서버에 연결하여 호스트 이름을 확인할 수 없음을 나타냅니다 mirrorlist.centos.org.

를 사용해보십시오 ping 8.8.8.8. 이것이 실패하면을 시도하십시오 ping <local-gateway-ip>. 그래도 실패하면 로컬 네트워크 구성이 잘못되어 구성을 확인해야합니다.

당신이 ping 할 수있는 경우 8.8.8.8, 사용하려고 host, nslookup또는 dig같은 DNS 설정을 확인 host google.com하거나 dig google.com. 실패하면 DNS 설정을 확인해야합니다. /etc/resolv.conf무엇이 구성되어 있는지 확인 하십시오.

최신 정보

/etc/resolv.conf공백 이므로 DNS 확인자를 설정해야합니다. 나는 사용하여 파일에 다음을 입력 제안 nano또는 vi(사용 또는 무엇이든 편안) :

nameserver 9.9.9.9

이 파일을 저장 한 후 yum update다시 시도 하십시오.

당신은 또한 같은 다른 DNS 호스트 오히려한다면, 시도 할 수 있습니다 8.8.8.8하거나 8.8.4.4또는 오픈 DNS 호스트 중 하나를.


답변

어딘가에 연결 문제가있을 수 있습니다. 여기서 문제가있는 위치를 확인하는 작은 프로세스입니다.

기본 연결

서버에 인터넷이 있는지 확인하십시오 (ip 주소 및 올바른 경로-작동하지 않으면 ip addressIP 주소가 있는지 확인하십시오 ).

 ping 8.8.8.8

리졸버

리졸버가 무엇인지 확인하고 핑

 cat /etc/resolv.conf

줄과 nameserverIP 주소 가 있어야 합니다. IP가 응답하는지 확인하십시오.

 ping xx.xx.xx.xx

그런 다음 nslookup을 수행하십시오.

 nslookup mirrorlist.centos.org

IP 주소 목록을 반환해야합니다. 그렇지 않으면 DNS 서버가 제대로 작동하지 않을 수 있습니다.

 nslookup
 > server 8.8.8.8
 > mirrorlist.centos.org

이번에는 예상대로 작동하는지 확인하십시오.