我无法安装 virtualbox。
我最近使用 ubuntu-server 14.04.4 重新安装了整个系统。我按照推荐添加了 virtualbox 存储库他们的网站: 我补充了
deb http://download.virtualbox.org/virtualbox/debian jessie contrib
到我的sources.list,添加他们的密钥,并apt-get update
-ed(所有这些都有效)。然后我去了apt-get install virtualbox-5.0
,它给了我这个错误:
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-5.0 : Depends: libdevmapper1.02.1 (>= 2:1.02.90) but 2:1.02.77-6ubuntu2 is to be installed
Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
我尝试按照建议检查任何保留的软件包并使用 aptitude这里。
apt-mark showhold
没有输出,并aptitude
声称唯一的解决方案是不安装virtualbox-5.0
:
gavinsyancey@boxen:~$ sudo aptitude install virtualbox-5.0
The following NEW packages will be installed:
libaudio2{a} libmysqlclient18{a} libqt4-declarative{a} libqt4-network{a} libqt4-opengl{a} libqt4-script{a} libqt4-sql{a} libqt4-sql-mysql{a} libqt4-xml{a} libqt4-xmlpatterns{a}
libqtdbus4{a} libqtgui4{a} mysql-common{a} virtualbox-5.0{b}
0 packages upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 73.9 MB of archives. After unpacking 191 MB will be used.
The following packages have unmet dependencies:
virtualbox-5.0 : Depends: libdevmapper1.02.1 (>= 2:1.02.90) but 2:1.02.77-6ubuntu2 is installed.
Depends: libstdc++6 (>= 4.9) but 4.8.4-2ubuntu1~14.04.1 is installed.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) virtualbox-5.0 [Not Installed]
Accept this solution? [Y/n/q/?] n
*** No more solutions available ***
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) virtualbox-5.0 [Not Installed]
Accept this solution? [Y/n/q/?]
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
此时我不知道下一步该做什么。如何在我的机器上安装 virtualbox?
根据要求,输出apt-cache policy virtualbox
是
virtualbox:
Installed: (none)
Candidate: 4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1
Version table:
4.3.36-dfsg-1+deb8u1ubuntu1.14.04.1 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/multiverse amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse amd64 Packages
4.3.10-dfsg-1 0
500 http://us.archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages
答案1
编辑/etc/apt/sources.list
文件并添加以下行之一:
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
保存并退出
更新 sudo apt-get update
安装dkms
sudo apt-get install dkms
设置oracle公钥:
wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
sudo apt-key add oracle_vbox.asc
安装 Oracle VirtualBox
sudo apt-get update
sudo apt-get install virtualbox-5.0
答案2
我设法通过从他们的网站下载 .deb 来安装它,然后运行
sudo dpkg -i the/path/to/virtualbox-5.0_5.0.16-105871-Ubuntu-trusty_amd64.deb
由于缺少依赖项而出现错误,然后
sudo apt-get install -f
实际安装它。
也就是说,GAD3R 的答案更好、更完整,但我仍然担心我可能会以这种方式破坏某些东西。