How to install Vagrant with manual VirtualBox 4.2?

How can I install Vagrant 1.0.6. with an already manually installed VirtualBox 4.2.6 on Ubuntu 12.04? All of my known ways fail:

  1. Download *.deb file for 64bit and dpkg --install vagrant_x86_64.deb gives me the error Vagrant not installed. Use apt-get install vagrant after using vagrant up.
  2. Using apt-get install vagrant wants to remove (!) my manual VirtualBox installation.

What to do?


Solution 1:

Use:

apt-get install vagrant --no-install-recommends

as a work-around.

See https://bugs.launchpad.net/ubuntu/+source/vagrant/+bug/1125097

Solution 2:

Find you installed vagrant in /opt/vagrant and create a symlink on you local bin.

sudo ln -s /opt/vagrant/bin/vagrant /usr/local/bin/vagrant

Hope that helps.

Solution 3:

Up to 1.0.7 the recommended way of installing vagrant is through RubyGems.

Update: now that someone down voted the answer, I realized that it should be updated anyway.

NOTE: Since Vagrant 1.1.x (now 1.2.4) the recommended way of installation is using the install package (DEB, RPM) for Linux, DMG for OS X and MSI Windows.

If you have up-to-date ruby version installed, just gem install vagrant.

You can install ruby using package management, of course. However, rbenv/ruby-build or RVM is highly recommended, it's more flexible and works great in terms of managing ruby versions.

Update: since 1.2, recommended way of installing Vagrant is using the installers for your OS.