Problem
- OS : Ubuntu 20.04.5 LTS
- 오랜만에 apt-get update 시도 했더니 아래와 같이 구글 cloud-sdk 관련 에러 발생
$> sudo apt-get update
Hit:1 http://mirror.kakao.com/ubuntu focal InRelease
Hit:2 http://mirror.kakao.com/ubuntu focal-updates InRelease
Hit:3 http://mirror.kakao.com/ubuntu focal-backports InRelease
Hit:4 http://mirror.kakao.com/ubuntu focal-security InRelease
Hit:5 https://apt.releases.hashicorp.com focal InRelease
Get:6 https://packages.cloud.google.com/apt cloud-sdk InRelease [6361 B]
Err:6 https://packages.cloud.google.com/apt cloud-sdk InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.cloud.google.com/apt cloud-sdk InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
W: Failed to fetch https://packages.cloud.google.com/apt/dists/cloud-sdk/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05
W: Some index files failed to download. They have been ignored, or old ones used instead.
Solution
Google Cloud 공개 키를 가져오는 명령어 실행해야 함
-
배포판의 apt-key 명령어가 --keyring 인수를 지원하는 경우
$> curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
-
배포판의 apt-key 명령어가 --keyring 옵션을 지원하지 않을 경우
$> curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
apt-key
명령어 option
-
--keyring
옵션을 사용해 특정 키링 파일을 지정할 수 있음 -
기본 설정은
/etc/apt/trusted.gpg
파일과/etc/apt/trusted.gpg.d
디렉토리의 모든 gpg 파일 사용 -
일반적으로
/etc/apt/trusted.gpg
에 새로운 키가 추가됨
참고자료
우분투(Ubuntu) 패키지 관리 - apt-key 명령 사용법
NO_PUBKEY error in google cloud debian packages update
gcloud CLI 설치