Skip to content

Instantly share code, notes, and snippets.

Last active Jun 1, 2017
What would you like to do?
Shell script to upgrade your vagrant to the latest version
ONLINE_VERSION=$(curl -s | grep -i 'x86_64.deb' | sed 's/.*\/vagrant_\(.*\)_x86_64\.deb.*/\1/i'
SYSTEM_VERSION=$(vagrant --version) | sed 's/^vagrant \(.*\)$/\1/i'
VAGRANT_CHECK=$(command -v vagrant >/dev/null 2>&1)
#if [ "$VAGRANT_CHECK" = 1 ]; then
echo "Downloading and installing Vagrant $ONLINE_VERSION (System version $SYSTEM_VERSION)"
PACKAGE=$(curl -s | grep -i 'x86_64.deb' | sed 's/.*href="\(.*\)".*/\1/i'
wget $PACKAGE /tmp/vagrant.deb
sudo dpkg -i /tmp/vagrant.deb
rm /tmp/vagrant.deb
echo "Vagrant successfully updated to $ONLINE_VERSION"
echo "No new Vagrant version!"

This comment has been minimized.

Copy link
Owner Author

@runcom runcom commented Feb 11, 2015

wget && chmod u+x update-vagrant

Also move the file to /home/$USER/bin or /usr/local/bin if you like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment