概要
サードパーティのリポジトリを追加している場合は gpg キーが定期的に更新される場合があるので更新してあげましょう
環境
- Ubuntu 24.04
エラーログ
Get:1 https://cli.github.com/packages stable InRelease [3,917 B]
Hit:2 https://aquasecurity.github.io/trivy-repo/deb generic InRelease
Err:1 https://cli.github.com/packages stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5612B36462313325
Hit:3 https://download.docker.com/linux/ubuntu noble InRelease
Get:4 https://apt.releases.hashicorp.com noble InRelease [12.8 kB]
Err:4 https://apt.releases.hashicorp.com noble InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560
Hit:5 http://repo.mysql.com/apt/ubuntu noble InRelease
Hit:6 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:7 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:8 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:9 https://ppa.launchpadcontent.net/ansible/ansible/ubuntu noble InRelease
Hit:10 https://ppa.launchpadcontent.net/git-core/ppa/ubuntu noble InRelease
Get:11 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease [8,371 B]
Get:12 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease [8,220 B]
Get:13 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease [8,235 B]
Get:14 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease [8,213 B]
Fetched 49.8 kB in 4s (12.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5612B36462313325
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://apt.releases.hashicorp.com noble InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560
W: Failed to fetch https://cli.github.com/packages/dists/stable/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5612B36462313325
W: Failed to fetch https://apt.releases.hashicorp.com/dists/noble/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560
W: Some index files failed to download. They have been ignored, or old ones used instead.
更新コマンド
# GitHub CLIの署名鍵を更新
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| sudo install -o root -g root -m 0644 /dev/stdin \
/etc/apt/keyrings/githubcli-archive-keyring.gpg
# HashiCorpの署名鍵を更新
curl -fsSL https://apt.releases.hashicorp.com/gpg \
| gpg --dearmor \
| sudo install -o root -g root -m 0644 /dev/stdin \
/usr/share/keyrings/hashicorp-archive-keyring.gpg
# 動作確認
sudo apt-get update
最後に
今回は github と hashicorp でしたが他でも同様に更新が必要になるケースがあります
