在 ubuntu 下 apt update 顯示 error message:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 467B942D3A79BD29 W: Some index files failed to download. They have been ignored, or old ones used instead.
這個問題,重開機還是會一直遇到,每次下 apt update 就會顯示。解法是服用下面的指令,還有每一台電腦顯示的 key 會不一樣,要修改為你的環境裡遇顯示的 key 值。
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467B942D3A79BD29
說明: NO_PUBKEY, 透過上面的指令, 加入 key 即可。
詳解:
https://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/
GPG error: The following signatures couldn’t be verified
The error tells you that your system cannot identify a certain GPG public key (PUBKEY). What you need to do is to fetch this public key in the system.
這次又遇到 NO_PUBKEY 的問題, 直接地加入沒有的KEY 還是無法解法, 新的錯誤訊息:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 35696F43FC7DB4C2
W: Failed to fetch https://repos-droplet.digitalocean.com/apt/droplet-agent/dists/main/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 35696F43FC7DB4C2
執行畫面:
cd /etc/apt/sources.list.d
rm 有問題的檔案.
wget -qO- https://repos-droplet.digitalocean.com/install.sh | sudo bash
再執行一次 apt udpate 就可以看到結果變正常了: