So the problem is with the sources.list file being used. Ultimately it links to a keyring, which doesn't contain key AA16FCBCA621E701
.
In my case this was the file /etc/apt/sources.list.d/hashicorp.list
deb [arch=amd64 signed-by=/usr/share/keyrings/terraform-archive-keyring.gpg] https://apt.releases.hashicorp.com jammy main
The above notes (thank you MacroMan), led me to this (which creates a new, valid hashicorp-archive-keyring.gpg, his original instructions don't work unless you're running as su - root
, which I never do)
curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
With the new keyring, edit the above file to replace terraform-archive-keyring.gpg
with hashicorp-archive-keyring.gpg
and sudo apt-get update
should run without errors.
Alternatively (I didn't run this, but someone might find it useful, as it recreates the sources.list using sudo tee
, so doesnt need to be run as root, as >
does)
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee etc/apt/sources.list.d/hashicorp.list