yum 명령어를 사용 시, 아래와 같은 오류가 뜨면서 yum 이 수행되지 않은 때 해결 방법입니다.
Loaded plugins: fastestmirror, langpacks Determining fastest mirrors 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; 알 수 없는 오류" One of the configured repositories failed (Unknown), 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=<repoid> ... 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 <repoid> or subscription-manager repos --disable=<repoid> 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=<repoid>.skip_if_unavailable=true Cannot find a valid baseurl for repo: base/7/x86_64
1. route 명령어로 게이트웨이가 제대로 설정되어 있는지 확인합니다.
# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default gateway 0.0.0.0 UG 100 0 0 enp7s0 192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 enp7s0 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0 gateway 0.0.0.0 255.255.255.255 UH 100 0 0 enp7s0
제대로 설정되어 있지 않은경우 게이트웨이 값을 설정한 뒤 네트워크를 재시작 합니다.
# cat /etc/sysconfig/network # Created by anaconda GATEWAY=192.168.0.1
# service network restart Restarting network (via systemctl): [ OK ]
# nslookup > server Default server: 127.0.0.1 Address: 127.0.0.1#53 Default server: 168.126.63.1 Address: 168.126.63.1#53 Default server: 168.126.63.2 Address: 168.126.63.2#53 > exit
제대로 설정되어 있지 않은경우 DNS 값을 설정합니다. 이 때 설정값은 1 개 이상이 될 수 있습니다.
# cat /etc/resolv.conf # Generated by NetworkManager nameserver 127.0.0.1 nameserver 168.126.63.1 nameserver 168.126.63.2
3. /etc/sysconfig/network-scripts/ifcfg-[이더넷명] 의 프로퍼티 값을 확인합니다.
GATEWAY, DNS, IPADDR, ONBOOT 등등의 설정값을 확인한 뒤 위에서 설정한 값과 동일하게 설정합니다.
# vi /etc/sysconfig/network-scripts/ifcfg-enp7s0
DEVICE="enp7s0" ONBOOT="yes" IPADDR="192.168.0.50" PREFIX="24" GATEWAY="192.168.0.1" DNS1="168.126.63.1"
4. 외부 아이피로 핑을 날려봅니다.
# ping 8.8.8.8 # google PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=30.9 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=30.1 ms --- 8.8.8.8 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 30.194/30.581/30.968/0.387 ms
5. 핑이 제대로 날라가면 yum 명령어를 다시 수행합니다.
yum 명령어가 적용되는 것을 확인할 수 있습니다.
# yum search cmake Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: data.nicehosting.co.kr * extras: data.nicehosting.co.kr * updates: data.nicehosting.co.kr base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/4): base/7/x86_64/primary_db | 5.9 MB 00:00:00 (2/4): extras/7/x86_64/primary_db | 147 kB 00:00:02 (3/4): base/7/x86_64/group_gz | 166 kB 00:00:03 (4/4): updates/7/x86_64/primary_db | 2.0 MB 00:00:18 ============================================================================================================ N/S matched: cmake ============================================================================================================= cmake-gui.x86_64 : Qt GUI for cmake cmake.x86_64 : Cross-platform make system Name and summary matches only, use "search all" for everything.
'Linux > 개념' 카테고리의 다른 글
[LINUX] Network 개념 CLOSE_WAIT 강제종료, 제거하기, TIME_WAIT 시간 줄이기 (0) | 2018.07.10 |
---|---|
[LINUX] tcpdump 로 전송되는 데이터 확인하기 (0) | 2018.06.18 |
[LINUX] SSH 접속이 느린 현상 해결하기 (0) | 2018.06.12 |
[LINUX] 디스크 HDD 와 SSD 확인하기 (0) | 2018.06.05 |
[LINUX] utf-8 파일의 BOM 제거하기 efbbbf 제거하기 (0) | 2018.05.30 |