[Ubuntu] Temporary failure resolving 'kr.archive.ubuntu.com' 에러 해결방법





우분투에서 apt-get update 명령어 실행 시 아래와 같이 오류가 발생하며 작동하지 않았다.
(apt-get dist-upgrade 명령어도 마찬가지..)
1004lucifer

lucifer@ubuntu:~$
lucifer@ubuntu:~$ sudo apt-get update
[sudo] password for lucifer:
Err:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'kr.archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'kr.archive.ubuntu.com'
Err:4 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'kr.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://kr.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'kr.archive.ubuntu.com'
W: Failed to fetch http://kr.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'kr.archive.ubuntu.com'
W: Failed to fetch http://kr.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'kr.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
lucifer@ubuntu:~$







원인

해당 우분투 서버에 등록된 DNS 에서 kr.archive.ubuntu.com 를 찾을 수가 없는상황.





해결방법

구글 공개 DNS 서버를 등록하여 해당 도메인을 찾을 수 있게 만든다.
1004lucifer

lucifer@ubuntu:~$ sudo vi /etc/resolv.conf

# 아래의 문자열을 추가한다.
nameserver 8.8.8.8
nameserver 8.8.4.4



네트워크를 재기동 한다.


lucifer@ubuntu:~$
lucifer@ubuntu:~$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:8b:e5:59
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe8b:e559/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:241073 errors:0 dropped:0 overruns:0 frame:0
          TX packets:112078 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:197342115 (197.3 MB)  TX bytes:7417090 (7.4 MB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0
          TX packets:172 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:12786 (12.7 KB)  TX bytes:12786 (12.7 KB)

lucifer@ubuntu:~$ # 아래의 enp0s3 은 본인의 NIC이름에 맞게 변경한다.
lucifer@ubuntu:~$ sudo ifdown enp0s3 && sudo ifup enp0s3
[sudo] password for lucifer:
Killed old client process
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp0s3/08:00:27:8b:e5:59
Sending on   LPF/enp0s3/08:00:27:8b:e5:59
Sending on   Socket/fallback
DHCPRELEASE on enp0s3 to 10.0.2.2 port 67 (xid=0x7f7fabc5)
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp0s3/08:00:27:8b:e5:59
Sending on   LPF/enp0s3/08:00:27:8b:e5:59
Sending on   Socket/fallback
DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0x2176fd7b)
DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0x2176fd7b)
DHCPREQUEST of 10.0.2.15 on enp0s3 to 255.255.255.255 port 67 (xid=0x7bfd7621)
DHCPOFFER of 10.0.2.15 from 10.0.2.2
DHCPACK of 10.0.2.15 from 10.0.2.2
bound to 10.0.2.15 -- renewal in 33886 seconds.
lucifer@ubuntu:~$






apt-get 명령어가 정상적으로 되는 것을 확인할 수 있다.
1004lucifer

lucifer@ubuntu:~$
lucifer@ubuntu:~$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Hit:3 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:4 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 102 kB in 8s (12.3 kB/s)
Reading package lists... Done
lucifer@ubuntu:~$
lucifer@ubuntu:~$
lucifer@ubuntu:~$
lucifer@ubuntu:~$
lucifer@ubuntu:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
  libdrm-common linux-headers-4.4.0-112 linux-headers-4.4.0-112-generic linux-image-4.4.0-112-generic linux-image-extra-4.4.0-112-generic
The following packages will be upgraded:
  apparmor apport bind9-host ca-certificates cloud-initramfs-copymods cloud-initramfs-dyn-netconf cryptsetup cryptsetup-bin curl distro-info-data dnsmasq-base dnsutils dpkg gcc-5-base git git-man grub-legacy-ec2 initramfs-tools initramfs-tools-bin initramfs-tools-core
  iproute2 klibc-utils libapparmor-perl libapparmor1 libbind9-140 libc-bin libc6 libcryptsetup4 libcurl3-gnutls libdb5.3 libdns-export162 libdns162 libdrm2 libgnutls-openssl27 libgnutls30 libicu55 libidn11 libisc-export160 libisc160 libisccc140 libisccfg140 libklibc
  liblwres141 libmspack0 libpam-systemd libperl5.22 libplymouth4 libpython3.5 libpython3.5-minimal libpython3.5-stdlib libseccomp2 libssl1.0.0 libstdc++6 libsystemd0 libtasn1-6 libudev1 libxml2 linux-firmware linux-generic linux-headers-generic linux-image-generic
  locales logrotate lshw lxcfs lxd lxd-client mdadm multiarch-support openssh-client openssh-server openssh-sftp-server openssl overlayroot perl perl-base perl-modules-5.22 plymouth plymouth-theme-ubuntu-text python3-apport python3-distupgrade python3-problem-report
  python3-update-manager python3.5 python3.5-minimal resolvconf rsync snapd squashfs-tools systemd systemd-sysv tcpdump tzdata ubuntu-minimal ubuntu-release-upgrader-core ubuntu-server ubuntu-standard udev unattended-upgrades update-manager-core update-notifier-common
  vlan wget xfsprogs
104 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 184 MB of archives.
After this operation, 369 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 dpkg amd64 1.18.4ubuntu1.3 [2,084 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libperl5.22 amd64 5.22.1-9ubuntu0.2 [3,391 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 perl amd64 5.22.1-9ubuntu0.2 [237 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 perl-base amd64 5.22.1-9ubuntu0.2 [1,282 kB]
Get:5 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 perl-modules-5.22 all 5.22.1-9ubuntu0.2 [2,661 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libc6 amd64 2.23-0ubuntu10 [2,580 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdb5.3 amd64 5.3.28-11ubuntu0.1 [670 kB]
Get:8 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 locales all 2.23-0ubuntu10 [3,213 kB]
Get:9 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libc-bin amd64 2.23-0ubuntu10 [641 kB]




참고
 - https://developers.google.com/speed/public-dns/docs/using
 - https://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error
 - https://askubuntu.com/questions/892569/apt-get-update-not-working-in-ubuntu-16-04-temporary-failure-resolving/907569#907569


댓글