Ubuntu 22.10下无法添加Oracle VirtualBox的GPG密钥到apt的问题求助
Ubuntu 22.10下无法添加Oracle VirtualBox的GPG密钥到apt的问题求助
大家好,我在给Ubuntu 22.10配置VirtualBox的apt源时碰到了GPG密钥验证的问题,试了好几种办法都没搞定,想请教下各位怎么解决。
我先做了这些准备:
- 把VirtualBox的apt源条目(发行版指定为"jammy")添加到了
/etc/apt/sources.list.d目录下 - 从VirtualBox的下载页面下载了密钥文件
oracle_vbox_2016.asc
之后我尝试了两种方法,但都没能让apt正常识别这个密钥:
使用apt-key添加密钥
执行命令:apt-key add oracle_vbox_2016.asc- 结果:收到了
apt-key已废弃的警告,但返回了"OK"提示 - 验证:
apt-key list能看到这个密钥 - 问题:运行
sudo apt update时,依然提示缺少签名为A2F683C52980AECF的公钥
- 结果:收到了
创建密钥环文件放到trusted.gpg.d
步骤:- 先移除了之前用apt-key添加的密钥
- 执行命令创建密钥环:
gpg --no-default-keyring --keyring gnupg-ring:./oracle_vbox.gpg --import oracle_vbox_2016.asc - 将生成的
oracle_vbox.gpg复制到/etc/apt/trusted.gpg.d目录 - 验证:
apt-key list里依然能看到该密钥 - 问题:
sudo apt update还是无法识别这个密钥,报错和之前一样
下面是相关命令的输出:
apt-key list的输出
$ apt-key list Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). /etc/apt/trusted.gpg -------------------- ... /etc/apt/trusted.gpg.d/oracle_vbox.gpg -------------------------------------- pub rsa4096 2016-04-22 [SC] B9F8 D658 297A F3EF C18D 5CDF A2F6 83C5 2980 AECF uid [ unknown] Oracle Corporation (VirtualBox archive signing key) <info@virtualbox.org> sub rsa4096 2016-04-22 [E]
sudo apt update的输出
$ sudo apt update ... Get:8 https://download.virtualbox.org/virtualbox/debian jammy InRelease [4,428 B] Err:8 https://download.virtualbox.org/virtualbox/debian jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF ... Reading package lists... Done W: GPG error: https://download.virtualbox.org/virtualbox/debian jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A2F683C52980AECF E: The repository 'https://download.virtualbox.org/virtualbox/debian jammy InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default.
备注:内容来源于stack exchange,提问作者Shachar Shemesh
相关产品推荐
相关产品推荐

