如何在 Ubuntu 17.10 中通过默认存储库安装 Virtual Box 的扩展包?

如何在 Ubuntu 17.10 中通过默认存储库安装 Virtual Box 的扩展包?

Virtual Box 已由以下人员安装:

sudo apt install virtualbox

然后我继续安装扩展包:

sudo apt install virtualbox-ext-pack

这会出现错误:

sudo apt install virtualbox-ext-pack 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  virtualbox-ext-pack
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/11,6 kB of archives.
After this operation, 127 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package virtualbox-ext-pack.
(Reading database ... 169888 files and directories currently installed.)
Preparing to unpack .../virtualbox-ext-pack_5.1.34-0ubuntu1.17.10.2_all.deb ...
License has already been accepted.
Unpacking virtualbox-ext-pack (5.1.34-0ubuntu1.17.10.2) ...
Setting up virtualbox-ext-pack (5.1.34-0ubuntu1.17.10.2) ...
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.34/Oracle_VM_VirtualBox_Extension_Pack-5.1.34.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
dpkg: error processing package virtualbox-ext-pack (--configure):
 subprocess installed post-installation script returned error exit status 4
Errors were encountered while processing:
 virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)

我已经尝试使用“apt purge ...”重新启动并重新安装。然而问题仍然存在。

如何在 Ubuntu 17.10 中通过默认存储库安装 Virtual Box 的扩展包?

我刚刚注意到目录/usr/share/virtualbox-ext-pack是空的。在参考系统上,文件夹包含该*.vbox-extpack文件。也许这是代理问题?

答案1

运行此命令时:

sudo apt install virtualbox-ext-pack

在安装过程中,virtualbox-ext-pack将从http://download.virtualbox.org/使用wget工具。

但正如你所说,你使用代理apt,而且你也无法访问http://download.virtualbox.org/站点,无需代理(因为curl: (6) Could not resolve host: download.virtualbox.org输出,在您的评论中)。

因此,您应该使用以下命令在终端上设置代理(不仅适用于 apt):

export http_proxy='http://proxyserveraddress:port'    
export https_proxy='https://proxyserveraddress:port'

在终端设置代理后,您的问题应该就解决了。

相关内容