我正在尝试从Microsoft APT 存储库安装一些软件包(因为我非常讨厌 Snap!)但我似乎无法添加它的密钥:
$ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
OK
它说好的,但钥匙不起作用:
$ sudo apt update
[...]
Err:7 https://packages.microsoft.com/repos/vscode stable InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Reading package lists... Done
W: GPG error: https://packages.microsoft.com/repos/vscode 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/vscode 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.
我还尝试从 apt-get 打印的 NO_PUBKEY id 开始检索密钥:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EB3E94ADBE1229CF
Executing: /tmp/apt-key-gpghome.q9IjlmqKv9/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv EB3E94ADBE1229CF
gpg: key EB3E94ADBE1229CF: "Microsoft (Release signing) <[email protected]>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
它说“没有改变”,事实上,什么都没有改变。
如果我检查输出apt-key list
我看到所有第三方密钥都有一个sub rsa4096
除了微软的。这就是它不起作用的原因吗?
$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2017-05-08 [SCEA]
1EDD E2CD FC02 5D17 F6DA 9EC0 ADAE 6AD2 8A8F 901A
uid [ unknown] Sublime HQ Pty Ltd <[email protected]>
sub rsa4096 2017-05-08 [S]
pub rsa4096 2016-04-12 [SC]
EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796
uid [ unknown] Google Inc. (Linux Packages Signing Authority) <[email protected]>
sub rsa4096 2019-07-22 [S] [expires: 2022-07-21]
pub rsa4096 2014-06-13 [SC]
9FD3 B784 BC1C 6FC3 1A8A 0A1C 1655 A0AB 6857 6280
uid [ unknown] NodeSource <[email protected]>
sub rsa4096 2014-06-13 [E]
pub rsa2048 2015-10-28 [SC]
BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF
uid [ unknown] Microsoft (Release signing) <[email protected]>
[...]
我该如何解决这个问题?
Ubuntu 20.04 焦点