我该如何摆脱 virtualbox 以便它不会阻止我通过 GPG 错误 [...] NO_PUBKEY [...] 进行更新?

我该如何摆脱 virtualbox 以便它不会阻止我通过 GPG 错误 [...] NO_PUBKEY [...] 进行更新?

我找到了很多关于如何修复 NO_PUBKEY 问题的指南,但我真正想要的是摆脱 VirtualBox,因为我从来没有让它工作过,而且现在还不需要它。所以我尝试通过指南摆脱它。这是完整的终端日志:

username@username-System-Product-Name:~$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 https://repo.steampowered.com/steam stable InRelease                                                        
Get:3 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]                                        
Hit:4 https://repo.nordvpn.com//deb/nordvpn/debian stable InRelease                                               
Get:5 https://download.virtualbox.org/virtualbox/debian jammy InRelease [4,428 B]                                 
Hit:6 http://security.ubuntu.com/ubuntu jammy-security InRelease                            
Get:7 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Err:5 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.
N: See apt-secure(8) manpage for repository creation and user configuration details.
username@username-System-Product-Name:~$ sudo apt-get purge virtualbox
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'virtualbox' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.

好的,另一个指南怎么样?:

username@username-System-Product-Name:~$ sudo apt-get purge virtualbox*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'virtualbox-ext-pack' for glob 'virtualbox*'
Note, selecting 'virtualbox' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-x11' for glob 'virtualbox*'
Note, selecting 'virtualbox-ose' for glob 'virtualbox*'
Note, selecting 'virtualbox-ose-fuse' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-additions-iso' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-modules' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-utils' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-utils-hwe' for glob 'virtualbox*'
Note, selecting 'virtualbox-guest-x11-hwe' for glob 'virtualbox*'
Note, selecting 'virtualbox-modules' for glob 'virtualbox*'
Note, selecting 'virtualbox-qt' for glob 'virtualbox*'
Note, selecting 'virtualbox-2.0' for glob 'virtualbox*'
Note, selecting 'virtualbox-2.1' for glob 'virtualbox*'
Note, selecting 'virtualbox-2.2' for glob 'virtualbox*'
Note, selecting 'virtualbox-3.0' for glob 'virtualbox*'
Note, selecting 'virtualbox-3.1' for glob 'virtualbox*'
Note, selecting 'virtualbox-3.2' for glob 'virtualbox*'
Note, selecting 'virtualbox-4.0' for glob 'virtualbox*'
Note, selecting 'virtualbox-4.1' for glob 'virtualbox*'
Note, selecting 'virtualbox-4.2' for glob 'virtualbox*'
Note, selecting 'virtualbox-4.3' for glob 'virtualbox*'
Note, selecting 'virtualbox-5.0' for glob 'virtualbox*'
Note, selecting 'virtualbox-5.1' for glob 'virtualbox*'
Note, selecting 'virtualbox-5.2' for glob 'virtualbox*'
Note, selecting 'virtualbox-6.0' for glob 'virtualbox*'
Note, selecting 'virtualbox-6.1' for glob 'virtualbox*'
Note, selecting 'virtualbox-source' for glob 'virtualbox*'
Note, selecting 'virtualbox-dkms' for glob 'virtualbox*'
Package 'virtualbox-ose' is not installed, so not removed
Package 'virtualbox-ose-fuse' is not installed, so not removed
Package 'virtualbox-6.1' is not installed, so not removed
Package 'virtualbox-6.0' is not installed, so not removed
Package 'virtualbox-5.2' is not installed, so not removed
Package 'virtualbox-5.1' is not installed, so not removed
Package 'virtualbox-5.0' is not installed, so not removed
Note, selecting 'virtualbox-dkms' instead of 'virtualbox-modules'
Package 'virtualbox-2.0' is not installed, so not removed
Package 'virtualbox-2.1' is not installed, so not removed
Package 'virtualbox-2.2' is not installed, so not removed
Package 'virtualbox-3.0' is not installed, so not removed
Package 'virtualbox-3.1' is not installed, so not removed
Package 'virtualbox-3.2' is not installed, so not removed
Package 'virtualbox-4.0' is not installed, so not removed
Package 'virtualbox-4.1' is not installed, so not removed
Package 'virtualbox-4.2' is not installed, so not removed
Package 'virtualbox-4.3' is not installed, so not removed
Package 'virtualbox' is not installed, so not removed
Package 'virtualbox-dkms' is not installed, so not removed
Package 'virtualbox-ext-pack' is not installed, so not removed
Package 'virtualbox-guest-additions-iso' is not installed, so not removed
Package 'virtualbox-guest-utils' is not installed, so not removed
Package 'virtualbox-guest-utils-hwe' is not installed, so not removed
Package 'virtualbox-guest-x11' is not installed, so not removed
Package 'virtualbox-guest-x11-hwe' is not installed, so not removed
Package 'virtualbox-qt' is not installed, so not removed
Package 'virtualbox-source' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.

这看起来好像没有起到什么作用...但为了以防万一,我们还是尝试再次更新:

username@username-System-Product-Name:~$ sudo apt update
Hit:1 https://repo.nordvpn.com//deb/nordvpn/debian stable InRelease
Hit:2 https://repo.steampowered.com/steam stable InRelease  
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:4 https://download.virtualbox.org/virtualbox/debian jammy InRelease [4,428 B]              
Err:4 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
Hit:5 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Get:6 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
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.
N: See apt-secure(8) manpage for repository creation and user configuration details.

答案1

您可以轻松删除 VirtualBox 存储库。使用软件和更新 GUI,或运行

sudo rm /etc/apt/sources.list.d/virtualbox*

如果您从 deb 文件安装了 VB,此命令将起作用。如果您手动添加了源,则需要找到源所在的位置,例如/etc/apt/sources.list

答案2

这不是关于一个名为virtualbox(或virtualbox-6.1或类似的)的包,而是关于存储库提供这些套餐。

存储库中的软件包可以进行加密签名。要检查​​这些签名,apt需要公钥与存储库关联。设置存储库时,您没有为其正确配置公钥。这就是apt抱怨的内容:

Err:5 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
(...)
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.
N: See apt-secure(8) manpage for repository creation and user configuration details.

有两种方法可以解决这个问题:如果您想继续从此存储库使用 Virtualbox,则需要提供apt存储库的公钥。或者您可以删除存储库,据我所知,这就是您想要做的。

为此,您需要查看已配置的存储库列表并删除相应的条目。它应该/etc/apt/sources.list直接位于 中,或者位于 中的单个文件中/etc/apt/sources.list.d,具体取决于您最初添加存储库的方式。

相关内容