When running sudo apt update, I am presented with the following error:
Err:4 https://apt.releases.hashicorp.com focal InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA16FCBCA621E701
How can I fix this?
Remove the existing Hashicorp files under /etc/apt/sources.list.d/ and then follow the official guide:
sudo -s
wget -O- https://apt.releases.hashicorp.com/gpg |
gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list
apt update
The GPG key is outdated or missing.
Run this code to remove the outdated key sudo rm /usr/share/keyrings/hashicorp-archive-keyring.gpg
And this to obtain the current key: curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg
I had the run that last one under root (sudo -s), as I couldn't get sudo to play ball with the pipe character. Not really sure why
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With