如何在Ubuntu上安装VirtualBox 4.2.16

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在Ubuntu上安装VirtualBox 4.2.16相关的知识,希望对你有一定的参考价值。

参考技术A 可以直接在软件中心安装virtualbox。virtualbox尽量安装最新版本。 如果软件中心的版本较低,可以到VB的官网下载Deb安装包。然后使用软件中心打开安装。

在 Ubuntu 20.04.1 LTS 上安装 VirtualBox 的问题

【中文标题】在 Ubuntu 20.04.1 LTS 上安装 VirtualBox 的问题【英文标题】:Problems with the installation of VirtualBox on Ubuntu 20.04.1 LTS 【发布时间】:2021-04-12 09:41:26 【问题描述】:

只是为了让您知道我在 Linux 方面还是个新手。

我刚刚从 Ubuntu 19.10 跳转到 Ubuntu 20.04.1 LTS,因为我认为 VirtualBox 不会有问题。 升级完成后发现VirtualBox不见了,我尝试按照官网和othersites的说明安装。

我不知道你们究竟需要什么来帮助我解决问题,所以这里有一些信息:

当我执行sudo apt update 时,会出现以下内容:

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:4 http://download.virtualbox.org/virtualbox/debian focal InRelease                    
Get:5 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [169 kB]        
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [412 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [93,5 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [724 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [399 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [180 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [11,4 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages [13,4 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [110 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [16,5 kB]
Fetched 2 352 kB in 1s (2 345 kB/s)                                 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
10 packages can be upgraded. Run 'apt list --upgradable' to see them.

现在sudo apt install virtualbox virtualbox-ext-pack

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package virtualbox is a virtual package provided by:
  virtualbox-6.1 6.1.16-140961~Ubuntu~eoan
  virtualbox-6.0 6.0.24-139119~Ubuntu~eoan
You should explicitly select one to install.

Package virtualbox-ext-pack is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'virtualbox' has no installation candidate
E: Package 'virtualbox-ext-pack' has no installation candidate

或者当我做sudo apt install virtualbox-6.0 时:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 virtualbox-6.0 : Depends: libqt5printsupport5 (>= 5.0.2) but it is not installable
                  Depends: python (< 2.8) but it is not installable
                  Depends: python (>= 2.7) but it is not installable
                  Depends: python:any (>= 2.6.6-7~)
                  Recommends: libsdl-ttf2.0-0 but it is not installable
                  Recommends: gcc but it is not going to be installed
                  Recommends: make but it is not going to be installed or
                              build-essential but it is not going to be installed or
                              dpkg-dev but it is not going to be installed
                  Recommends: binutils but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我做到了

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | \
     sudo tee -a /etc/apt/sources.list.d/virtualbox.list

没有任何问题。

我希望每个人都有美好的一天:)

【问题讨论】:

【参考方案1】:

#只需下载一个 debian 文件:

https://download.virtualbox.org/virtualbox/6.1.16/virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb

并安装:

sudo dpkg -i virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb

#If get's Any error

sudo apt install -f

【讨论】:

【参考方案2】:

只需在您的系统中添加一个存储库即可下载 virtualbox 所需的软件包:

deb http://deb.debian.org/debian buster main contrib non-free

然后用命令重新安装:

sudo apt install virtualbox-6.1

它对我有用。

【讨论】:

【参考方案3】:

我是通过以下方式解决的

sudo add-apt-repository 宇宙 sudo add-apt-repository 多元宇宙 sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian 仿生贡献" sudo apt-get 更新

如果在进行 apt-get update 时出现:

N:跳过获取配置文件“contrib/binary-i386/Packages”作为存储库“http://download.virtualbox.org/virtualbox/debian bionic InRelease”不支持架构“i386”

然后:

echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list

继续: sudo apt-get 更新 sudo apt-get 升级 sudo apt-get install libpng16-16 libqt5core5a libqt5printsupport5 libqt5widgets5 libqt5x11extras5 sudo apt-get install virtualbox-6.0

【讨论】:

以上是关于如何在Ubuntu上安装VirtualBox 4.2.16的主要内容,如果未能解决你的问题,请参考以下文章

如何在ubuntu上安装virtualbox的driver module vboxdrv

如何在Linux系统上安装Android 4.4

如何在Linux系统上安装Android 4.4

如何在Linux系统上安装Android 4.4

如何从安装在 Ubuntu 18.04 VirtualBox 上的 Wordpress Web 界面写入/上传

virtualbox ubuntu虚拟机怎么看共享文件夹