Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NO_PUBKEY for apt.releases.hashicorp.com in apt

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?

like image 278
MacroMan Avatar asked Jan 27 '26 16:01

MacroMan


2 Answers

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
like image 179
jpsecher Avatar answered Jan 29 '26 12:01

jpsecher


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

like image 22
MacroMan Avatar answered Jan 29 '26 12:01

MacroMan