这是我遇到的错误消息:
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 focal
InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA16FCBCA621E701.
然后我运行了这个:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys AA16FCBCA621E701
sudo apt-key list
只是为了确保密钥已导入,并且确实已导入。但是当我运行sudo apt-get update
答案1
在 sudo 下:
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg
gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint
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