I was getting the following error with Ansible when running a Playbook against a server:
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
It turned out that Ansible was attempting to perform an “apt update” and failing, but just ended up timing out.
Manually running “apt update” then gave the following error, which was what was tripping up the Playbook and causing it to time out.
Hit:4 https://ubuntu-mirrors.internal.sanger.ac.uk/noble noble-updates InRelease
Hit:5 https://ubuntu-mirrors.internal.sanger.ac.uk/noble noble-security InRelease
Hit:6 https://ubuntu-mirrors.internal.sanger.ac.uk/noble noble-backports InRelease
Err:7 https://apt.releases.hashicorp.com noble InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560
Fetched 29.4 kB in 1s (49.0 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 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://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://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.
To resolve this I just needed to ensure that (in this case) the Hashicorp GPG key was updated. First find the source with the cat, then remove the GPG public key and re-download.
# cat /etc/apt/sources.list.d/hashicorp.list
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com jammy main
# rm /usr/share/keyrings/hashicorp-archive-keyring.gpg
#curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg
Re-run “apt update”, if it works, you should be good to re-run the Ansible.