3

Im trying to download and install virtualbox 5.0 by sudo apt-get install virtualbox-5.0

and get the error:

unable to locate package virtualbox-5.0
Couldn't find any package by regex 'virtualbox-5.0'

I get the same error messages for 4.3, 5.1 ...

Am I doing something wrong here? how should I install the 5 version?

my second question- I need to download and install guest addition, do I need to download a specific version for 5.0? or other version?

EDIT:

  1. If I run the command sudo apt-get install virtualbox I get 4.1 version.
  2. the installation is offline, so I download list of .deb files (apt-get install- to file, then download the deb files and after that install it on offline computer), and commands like update or autoremove or just apt-get install doesn't fits on my case.

thanks.

1
  • which ubuntu version you are using? Jul 17, 2016 at 9:54

2 Answers 2

3

That is because there is not a package in the standard repositories with such a name, to get the latest in the repositories then run:

sudo apt-get install virtualbox

If you already have the virtualbox .deb file you wish to install it then simply cd into the relevant folder and run (<package-name> being the name of the .deb file you wish to install):

sudo dpkg -i <package-name>

If you do not already have it then you may download it from the official page (there are download links at the top of the page).

If you want it from the official VirtualBox repository though you will need to run:

echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/oracle-virtualbox.list

Then add the key (for version 16.04 and above):

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

Or this one (for version below 16.04):

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

And then run:

sudo apt-get update
sudo apt-get install dkms
sudo apt-get install virtualbox-5.1

Which is currently (at the time of this writing) the latest version, though you may replace the version number with whichever you like the install that version.

Source and further reference.

To answer your second question: the guest addition comes with the VirtualBox version you install. You can install it on a VM by going Devices > Insert Guest Additions Installation CD (though you will have to do this again every time you upgrade your VirtualBox version as the guest additions installation doesn't upgrade by itself on your VMs). Ubuntu will ask you if you wish to run the contents of the inserted CD, say you do and then it will install it.

5
  • Hi, thanks for your reply, please see my edits
    – userd
    Jul 17, 2016 at 10:39
  • Which Ubuntu version are you running?
    – user364819
    Jul 17, 2016 at 10:41
  • And I understand that you have now downloaded the relevant .deb file (I have updated my answer with installation instructions for that) or could you further clarify what you mean?
    – user364819
    Jul 17, 2016 at 10:42
  • my ubuntu version is 12.04 xubuntu. Im trying to download the 15 version but I get those errors.. if I just type virtualbox without any specific version, it downloads the 4.1 version
    – userd
    Jul 17, 2016 at 10:58
  • @userd: I don't think that that virtualbox version is available for 12.04 in the standard repositories, you should try the official virtualbox one I gave installation instructions for. Or try downloading the 12.04 latest version from here (at the top of the page you will find download links).
    – user364819
    Jul 17, 2016 at 11:14
0

If you have now problems while installing Ubuntu with sudo apt-get install virtualbox-6.*, use the following command instead:

sudo apt install virtualbox-6.*

It may save you a lot of time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .