安装 MS VS Code 并执行sudo apt 更新。出现错误。
Err:4 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
阅读软件包列表后,出现后续 GPG 错误
W: 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
E: The repository 'https://packages.microsoft.com/repos/code stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
到目前为止,我使用 vscode 没有任何问题,并且 vscode 在 Python 和其他几种语言上运行良好。我可以说它没有影响软件/应用程序本身。但是,在执行 sudo apt-get update 时,我仍然发现错误有点烦人。有没有办法解决这个问题,或者至少消除每次执行 sudo apt-get update 时出现的这个错误?
其他附加信息:
操作系统:Ubuntu 22.04.1 LTS x86_64 Jammy Jellyfish
外壳:bash 5.1.16
答案1
您可以使用以下命令重新签名密钥:
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
rm -f packages.microsoft.gpg