问题:
sudo apt update
报错 :
GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
一般遇到NO_PUBKEY只需要添加这个key就行:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8
但是对于这个docker的key却不行。
解决办法
First, add key to /usr/share/keyrings/docker-archive-keyring.gpg
by command:
sudo curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | sudo gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg
PS For some the part gpgp --dearmor
was useful.
Second, update permissions for it:
sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg
Then,
sudo apt update
参考:
Docker: How to solve the public key error in ubuntu while installing docker - Stack Overflow