在 Ubuntu 20.04.1 LTS 上安装 VirtualBox 的问题

时间:2021-01-06 16:08:09

标签: installation virtualbox ubuntu-20.04

只是为了让您知道我对 Linux 还很陌生。

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

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

这是我执行 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 个答案:

答案 0 :(得分:0)

#只需下载一个 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