How do I upgrade Vagrant to the latest version in Ubuntu?

Solution 1:

The official Download Vagrant webpage has all the available downloads for the latest version of Vagrant (2.0.1). Please download the proper package for your operating system (Linux deb) and architecture (32-bit or 64-bit OS). You can find SHA256 checksums for packages here.

Download the .deb file and double-click it to open it for installation in the Ubuntu software application. The new installation will properly overwrite and remove old files. It is recommended that no other Vagrant processes are running during the upgrade process.

The names of the vagrant .deb files are as follows:

  • 32-bit architecture: vagrant_2.0.1_i686.deb
  • 64-bit architecture: vagrant_2.0.1_x86_64.deb

...where 2.0.1 in the above is the version number of the latest version of Vagrant from the official download Vagrant webpage, which changes whenever the latest version of Vagrant is updated. The latest version of Vagrant from the official download Vagrant website current to the last time this answer was edited is Vagrant 2.2.6.

If you download the text file that has the SHA256 checksums for Vagrant packages, you will find the same two package names and their SHA256 checksums.

Solution 2:

If you don’t want to have to update manually, Hashicorp now has an official repository you can install from to get automatic updates. To use it, just run:

curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update

Edit: this post originally described a third-party deb repository. Now that Hashicorp has an official one of their own I've updated it to describe that one.

NOTE: if you previously set up that third-party repository, there is an extra step you need to take to ensure you will get updates from the new repository. Please see the old repo instructions for details.