Last active
February 26, 2020 18:54
-
-
Save lox/52f27919816a7eadb6d3 to your computer and use it in GitHub Desktop.
Uninstall VirtualBox from the command-line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
version=$(VBoxManage --version) | |
filename="VirtualBox-${version//r/-}-OSX.dmg" | |
base=$(echo ${version//r/-} | cut -d- -f1) | |
echo "downloading installer (for uninstall tool)" | |
if ! [ -f ~/Downloads/$filename ]; then | |
curl -C - -L -o ~/Downloads/$filename \ | |
"http://download.virtualbox.org/virtualbox/$base/$filename" | |
fi | |
( | |
cd ~/Downloads | |
echo "mounting volume" | |
hdiutil attach $filename > /dev/null | |
yes 'Yes' | sudo /Volumes/VirtualBox/VirtualBox_Uninstall.tool | |
hdiutil detach /Volumes/VirtualBox > /dev/null | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with
curl -s https://gist.githubusercontent.com/lox/52f27919816a7eadb6d3/raw/uninstall_virtualbox.sh | bash