
최신 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 ~]#
그래서 저장소를 나열하면 다음과 같은 결과를 얻습니다.
[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
답변1
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
사용해 또는 같은 DNS 설정을 확인해 보세요 . 이것이 실패하면 DNS 설정을 확인해야 합니다. 무엇이 구성되어 있는지 확인하세요 .host
nslookup
dig
host google.com
dig google.com
/etc/resolv.conf
업데이트
비어 있으므로 /etc/resolv.conf
DNS 확인자를 설정해야 합니다. nano
또는 vi
(또는 편안하게 사용하는 것)을 사용하여 파일에 다음을 입력하는 것이 좋습니다 .
nameserver 9.9.9.9
이 파일을 저장한 후 yum update
다시 시도하세요.
원하는 경우 OpenDNS 호스트 8.8.8.8
등 다른 DNS 호스트를 사용해 볼 수도 있습니다.8.8.4.4
답변2
어딘가에 연결 문제가 있을 수 있습니다. 여기에서는 문제가 있는 위치를 확인하는 간단한 프로세스가 있습니다.
기본 연결
서버에 인터넷이 있는지 확인하세요(IP 주소와 올바른 경로 - 작동하지 않으면 ip address
IP 주소가 있는지 확인하세요).
ping 8.8.8.8
리졸버
리졸버가 무엇인지 확인하고 핑(Ping)하십시오.
cat /etc/resolv.conf
회선 nameserver
과 IP 주소가 있어야 합니다. IP가 응답하는지 확인하세요.
ping xx.xx.xx.xx
그런 다음 nslookup을 수행하십시오.
nslookup mirrorlist.centos.org
IP 주소 목록이 반환되어야 합니다. 그렇지 않은 경우 DNS 서버가 올바르게 작동하지 않을 수 있습니다. 다음을 사용하여 다른 서버를 시도해 볼 수 있습니다.
nslookup
> server 8.8.8.8
> mirrorlist.centos.org
이번에는 예상대로 작동하는지 확인하세요.
답변3
Centos 스트림에서 이 문제가 발생하여 상단 표시줄에서 네트워크를 클릭하고 유선 네트워크에 연결해야 했습니다.
답변4
해당 VM에 네트워크 연결이 있는지 확인하십시오. NAT를 통한 네트워크 연결이 있고 HOST ONLY 브리지가 있는 경우 네트워크 장치를 활성화하십시오.
내 VM에서도 이와 같은 문제가 발생했습니다.