2022-06-24

6/24

Ubuntuでapt update時にGPGエラー

GCPのパッケージでエラー。

$ sudo apt update
:
Err:6 http://packages.cloud.google.com/apt google-cloud-monitoring-bionic-all InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
Err:4 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
Fetched 252 kB in 1s (209 kB/s)
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: http://packages.cloud.google.com/apt google-cloud-monitoring-bionic-all InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C283 * Super-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: http://packages.cloud.google.com/apt google-cloud-monitoring-bionic-all InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
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 kubernetes-xenial InRelease: The following signatures couldn't be
verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
W: Failed to fetch http://packages.cloud.google.com/apt/dists/google-cloud-monitoring-bionic-all/InRelease  The following
signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
W: Failed to fetch https://apt.kubernetes.io/dists/kubernetes-xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FEEA9169307EA071 NO_PUBKEY 8B57C5C2836F4BEB
W: Some index files failed to download. They have been ignored, or old ones used instead.

Google Cloud PackagesのGPGでエラー。2018/04/02 - Qiita を参考にGPGキーを更新(追加)。

$ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2537  100  2537    0     0  13423      0 --:--:-- --:--:-- --:--:-- 13423
OK

これで上手く行った。

$ apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa2048 2018-04-01 [SCE] [expired: 2021-03-31]
      54A6 47F9 048D 5688 D7DA  2ABE 6A03 0B21 BA07 F4FB
uid           [ expired] Google Cloud Packages Automatic Signing Key <[email protected]>

pub   rsa2048 2020-12-04 [SC] [expires: 2022-12-04]
      59FE 0256 8272 69DC 8157  8F92 8B57 C5C2 836F 4BEB
uid           [ unknown] gLinux Rapture Automatic Signing Key (//depot/google3/production/borg/cloud-rapture/keys/cloud-rapture-pubkeys/cloud-rapture-signing-key-2020-12-03-16_08_05.pub) <[email protected]>
sub   rsa2048 2020-12-04 [E]

pub   rsa2048 2021-03-01 [SC] [expires: 2023-03-02]
      7F92 E05B 3109 3BEF 5A3C  2D38 FEEA 9169 307E A071
uid           [ unknown] Rapture Automatic Signing Key (cloud-rapture-signing-key-2021-03-01-08_01_09.pub)
sub   rsa2048 2021-03-01 [E]

:

参考: