4

Is there a command that allows one to update all currently installed Vagrant plugins?

I am using the original install command to update each individually at the moment, but this is not ideal.

Michael Robinson
  • 29,278
  • 12
  • 104
  • 130

3 Answers3

17

Vagrant >=1.5

vagrant plugin update

Vagrant <1.5

Here is a single line command to update the installed Vagrant plugins.

for plugin in $(vagrant plugin list | cut -f1 -d' '); do vagrant plugin install $plugin; done;

Kevin Risden
  • 306
  • 2
  • 7
  • 2
    `vagrant plugin list` may output extra warning info at the top so `cut` may not be able to handle it correctly. Hopefully `vagrant plugin update all` will be implemented soon. – Terry Wang Dec 19 '13 at 01:39
  • This command won't work with the upgrade to Vagrant 1.4 since there is a warning about needing to remove all the plugins and reinstall them. I that an update command is added to `vagrant plugin` as @TerryWang has said. – Kevin Risden Dec 24 '13 at 05:36
4

As far as I know there is no built-in command to achieve this. But you could for example write a little shell-script, that reads the currently installed plugins from the directory ~\.vagrant.d\gems\gems and then runs vagrant plugin install for each of them.

avhilchen
  • 99
  • 4
0

A very easy one-liner:

vagrant plugin update $(vagrant plugin list |awk '/^[:alnum:]/i {print $1}')

The CLI output will be (for e.g.):

Updating plugins: vagrant-bindfs, vagrant-hostsupdater, vagrant-share, vagrant-vbguest. This may take a few minutes...
All plugins are up to date.

This will fetch all plugins from vagrant plugin list that have an alphanumeric name.

Lower-/Uppercase does not matter – The awk Regex is case insensitive.

kaiser
  • 21,817
  • 17
  • 90
  • 110