'"virtualbox is not installed" : Error while uninstalling virtual box on Mac

I have installed vagrant and virtualbox on my Mac using brew cask. I want to uninstall virtual box. I get the following error when I run the brew cask uninstall virtualbox

Error: virtualbox is not installed

I can clearly see that virtualbox is installed on my machine and it appears in launcher section. I also see virtualbox, when I run the following command.

$brew cask list
adium          adobe-reader   consul         google-chrome  iterm2     java6      osxfuse    vagrant    virtualbox     xquartz 

Am I missing something here which prevents me to uninstall virtualbox. Any help would be appreciated.



Solution 1:[1]

This is a bug #2580 -> #14058 in brew cask list. You can hard remove all existing casks with:

rm -rf /opt/homebrew-cask/Caskroom/virtualbox

or

brew cask zap virtualbox

You can then reinstall.

Solution 2:[2]

This alternative to force the uninstallation.

brew uninstall --cask virtualbox --force

Regards!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 childno͡.de
Solution 2 Yunnosch