問題
Ubuntu 更新時遇到:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://nginx.org/packages/ubuntu jammy InRelease: The following signatures were invalid: EXPKEYSIG ABF5BD827BD9BF62 nginx signing key signing-key@nginx.com
W: Failed to fetch https://nginx.org/packages/ubuntu/dists/jammy/InRelease The following signatures were invalid: EXPKEYSIG ABF5BD827BD9BF62 nginx signing key signing-key@nginx.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
Listing... Done
解法
這個錯誤訊息表示 nginx
軟體倉庫的 GPG 簽名金鑰已經過期,導致無法驗證倉庫的完整性。為了解決這個問題,你需要更新 nginx
的 GPG 簽名金鑰。請按照以下步驟進行:
移除過期的金鑰:
sudo apt-key del ABF5BD827BD9BF62
下載並新增新的金鑰:
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
更新軟體包列表:
sudo apt update
這樣應該可以解決 GPG 簽名金鑰過期的問題,並讓你能正常更新 nginx
軟體倉庫。如果問題仍然存在,請確認你所使用的 nginx
倉庫 URL 是否正確,並確保你的網路連接沒有問題。