升级到 Ubuntu 20.04 时出现此 gpg 错误:
GPG error: https://packages.microsoft.com/repos/code stable InRelease:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
答案1
您可以使用以下命令将密钥添加到系统:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF
如果还没有工作,你可以结帐如何修复 GPG 错误“NO_PUBKEY”?
或者
使用以下命令重新签名密钥:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg