ubuntu apt-get update시 발생하는 architecture 에러

CTF를 하다 보면, 문제에 맞는 환경을 구축하기 위해 다양한 명령어도 쳐보고 툴도 설치하곤 합니다.

이러한 짓들을 반복하다가 갑자기 `sudo apt update`가 에러를 뱉네요

 

에러 문구를 읽어보면 gnueabihf 아키텍처를 지원 안 하다는 에러와  arm64 package를 찾을 수 없다는 듯한 에러가 보이네요. gnueabihf 아키텍처 에러는 그래도 package 서버에 ping은 가는지 skip 되었지만, arm64의 경우 404 에러가 나면서 apt update 자체를 fail 시켜버리더라구요

 

 

# 에러 문구
N: Skipping acquire of configured file 'partner/binary-gnueabihf/Packages' as repository 'http://archive.canonical.com/ubuntu jammy InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'main/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'restricted/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'universe/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'multiverse/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'main/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'restricted/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'universe/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'multiverse/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'main/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-security InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'restricted/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-security InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'universe/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-security InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'multiverse/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-security InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'main/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'restricted/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'universe/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' doesn't support architecture 'gnueabihf'
N: Skipping acquire of configured file 'multiverse/binary-gnueabihf/Packages' as repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' doesn't support architecture 'gnueabihf'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/main/binary-armhf/Packages  404  Not Found [IP: 91.189.91.83 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.83 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.83 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

 

제가 분명 패키지 서버에 이런저런 아키텍처를 추가했었을 테니, dpkg에 있는 remove 옵션으로 해당 아키텍처를 패키지 서버에서 지워주면 해결할 수 있습니다 :)

 

해결방법

# sudo dpkg --remove-architecture [아키텍쳐]

$ sudo dpkg --remove-architecture gnueabihf
$ sudo dpkg --remove-architecture arm64

 

이후 sudo apt update 명령어를 입력하니 문제없이 apt 패키지 정보를 업데이트할 수 있었습니다.

  Comments,     Trackbacks