3

I can't get virtualbox to install.

I recently reinstalled my entire system with ubuntu-server 14.04.4. I added the virtualbox repository as recommended on their website: I added

deb http://download.virtualbox.org/virtualbox/debian jessie contrib

to my sources.list, added their key, and apt-get update-ed (all of which worked). I then went to apt-get install virtualbox-5.0 and it gave me this error:

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.

I tried checking for any held packages and using aptitude, as recommended here.

apt-mark showhold had no output, and aptitude claimed the only solution was to not install 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.

At this point I'm at a loss for what to do next. How can I install virtualbox on my machine?

As requested, the output of apt-cache policy virtualbox is

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
3
  • Use your distribution's own packages, not third party packages. Virtualbox is certainly available for Ubuntu. What is the output of apt-cache policy virtualbox? Mar 15 '16 at 18:05
  • @Faheem Virtualbox version 5.0 is not available in the ubuntu repositories. Also, I edited the output of your command into the question. Mar 15 '16 at 18:11
  • Ok. Well, you could backport it from a newer Ubuntu release. Mar 15 '16 at 22:09
3

Edit /etc/apt/sources.list file and add one of following line :

 deb http://download.virtualbox.org/virtualbox/debian trusty contrib

Save and exit

update sudo apt-get update

Install dkms

 sudo apt-get install dkms

Setup oracle public key:

 wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
 sudo apt-key add oracle_vbox.asc

Install Oracle VirtualBox

 sudo apt-get update
 sudo apt-get install virtualbox-5.0
3
  • 1
    I didn't know you could set the version to 'trusty'! They should list that on their website along with all of the debian versions that are available. Mar 15 '16 at 18:19
  • ...apparently, they do list it there, and I was blind enough to miss it... Mar 15 '16 at 18:25
  • 1
    trusty isn't a Debian release. They have mixed Debian and Ubuntu releases together under the debian directory. Sloppy. Mar 15 '16 at 22:10
1

I managed to get it to install by downloading the .deb from their website, then running

sudo dpkg -i the/path/to/virtualbox-5.0_5.0.16-105871-Ubuntu-trusty_amd64.deb

which gave an error because of missing dependencies, then

sudo apt-get install -f

to actually install it.

That said, GAD3R's answer is better and more complete, and I'm still worried I might have broken something this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.