Upgrading Vagrant in Ubuntu 16.04

Sukumar picture Sukumar · Oct 29, 2017 · Viewed 12.8k times · Source

I currently have Vagrant 1.8.1 installed in my Ubuntu 16.04

I'm thinking to upgrade it to Vagrant 2.0.0

The problem is I'm not sure if my vagrant files and VMs gets removed if I directly install Vagrant 2.0.0 using apt-get install vagrant.

Is it safe to update using apt-get or is there any way to do that.

Answer

Sufiyan Ghori picture Sufiyan Ghori · Apr 24, 2018

Vagrant repository probably not updated to the latest version, this is the reason that it always install older version when apt-get install vagrant command is used.

The easiest way to pull and install latest version using terminal is to find the path to the .deb file and install it using dpkg

You may get the list of all the vagrant updates here,

https://releases.hashicorp.com/vagrant/

I got this as latest version from above archive,

https://releases.hashicorp.com/vagrant/2.0.4/vagrant_2.0.4_x86_64.deb

Once you have that link, delete previous version of vagrant (if it is installed) as follows,

sudo apt-get remove --auto-remove vagrant
rm -r ~/.vagrant.d

and install newest version,

wget https://releases.hashicorp.com/vagrant/2.0.4/vagrant_2.0.4_x86_64.deb
sudo dpkg -i vagrant_2.0.4_x86_64.deb

Once done, you can verify if its successfully installed,

vagrant version