apt update で GPG エラーが発生

いつものようにapt updateを実行。

# apt update

ところがエラーが発生してリポジトリの更新がうまくいかない。内容を見るに先日PHP7.3導入のために追加した packages.sury.org へのアクセスでGPGエラーが発生しているようだ。

Get:7 https://packages.sury.org/php stretch InRelease [6,760 B]
Err:7 https://packages.sury.org/php stretch InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
Fetched 6,760 B in 1s (3,694 B/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
All packages are up to date.
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.sury.org/php stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Failed to fetch https://packages.sury.org/php/dists/stretch/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B188E2B695BD4743
W: Some index files failed to download. They have been ignored, or old ones used instead.

どうしたものか調べていくとこのあたりのサイトが参考になった。

Failed to fetch https://packages.sury.org/php/dists/jessie/InRelease - Jesús Amieiro
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: jessie InRelease: T...
DPA New Signing Key | Ondřej Surý on Patreon
Official Post from Ondřej Surý: I was informed that the current DPA signing key DF3D585DB8F0EB658690A554AC0E47584A7A714D was present on the server maintained by...

原因であるGPGファイルを更新。

# wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

改めて apt update を実行で無事成功。

コメント