当使用apt仓库条目的"Signed-by"选项时,如果密钥不可读,则apt会抛出错误。
示例:
为什么会这样呢?
示例:
deb [arch=amd64 signed-by=/etc/apt/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com jammy main
sudo chmod 660 /etc/apt/keyrings/hashicorp.gpg
sudo apt-get update
https://apt.releases.hashicorp.com jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY DA418C88A3219F7B
sudo chmod 664 /etc/apt/keyrings/hashicorp.gpg
sudo apt-get update
Hit:10 https://apt.releases.hashicorp.com jammy InRelease
为什么会这样呢?