OS/Linux

[Ubuntu Error Fix] Some index files failed to download. They have been ignored, or old ones used instead.

아르비스 2020. 9. 29. 08:24

ubuntu apt update 중 다음 에러가 발생한다...ㅠㅠ 

근데 해결이 어렵다..

그래서 정리한다.

에러 내용..

root@a-dev-node1:~# apt update
Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease                                  
Hit:4 http://archive.canonical.com/ubuntu focal InRelease                                                         
Get:2 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8993 B]                                  
Hit:5 http://asia-northeast3-b.gce.clouds.archive.ubuntu.com/ubuntu focal InRelease                     
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages
Hit:7 http://asia-northeast3-b.gce.clouds.archive.ubuntu.com/ubuntu focal-updates InRelease
Err:6 https://packages.cloud.google.com/apt kubernetes-xenial/main amd64 Packages
  404  Not Found [IP: 172.217.26.110 443]
Hit:8 http://asia-northeast3-b.gce.clouds.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists... Done
E: Failed to fetch https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-amd64/by-hash/SHA256/0bdf4cd80734fa377d0f0e01f5cf953c8b40db265f6559015ac2f4acb5606f0d  404  Not Found [IP: 172.217.26.110 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
root@a-dev-node1:~# 

 

해결 방법

$ sudo mv /etc/apt/sources.list{,.backup}

$ sudo mv /etc/apt/sources.list.d{,.backup}

output

$ cat /usr/share/doc/apt/examples/sources.list

# See sources.list(5) manpage for more information
# Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool.
deb http://us.archive.ubuntu.com/ubuntu focal main restricted
deb-src http://us.archive.ubuntu.com/ubuntu focal main restricted

deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb-src http://security.ubuntu.com/ubuntu focal-security main restricted

deb http://us.archive.ubuntu.com/ubuntu focal-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu focal-updates main restricted
$ sudo mkdir /etc/apt/sources.list.d

$ sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list

$ sudo apt update

 

결과 확인

$ apt update
Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease           
Get:2 http://us.archive.ubuntu.com/ubuntu focal InRelease [265 kB]         
Get:3 http://security.ubuntu.com/ubuntu focal-security/main Sources [56.2 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/restricted Sources [4244 B]
Get:5 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/restricted Sources [6472 B]
Get:7 http://us.archive.ubuntu.com/ubuntu focal/main Sources [847 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages [970 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal/main Translation-en [506 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata [29.5 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [22.0 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu focal/restricted Translation-en [6212 B]
Get:13 http://us.archive.ubuntu.com/ubuntu focal/restricted amd64 c-n-f Metadata [392 B]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-updates/main Sources [190 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted Sources [5272 B]
Get:16 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [375 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [142 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [9876 B]
Get:19 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [43.6 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [10.8 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [352 B]
Fetched 3600 kB in 3s (1257 kB/s)                                     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
$

 

끝... Gooooood~!