35

I tried, while I am in /opt/homebrew-cask/Caskroom

$ for i in *; do brew cask uninstall $i; done
Error: appcleaner is not installed
Error: avidemux is not installed
Error: eclipse-ide is not installed
Error: flash is not installed
Error: silverlight is not installed
Error: thunderbird is not installed
Error: vlc is not installed
nohillside
  • 100,768
Sybil
  • 3,937
  • 14
  • 48
  • 81

4 Answers4

35
brew uninstall [app] --cask --zap --force

--zap will remove config files and settings.

This will remove all versions of a Cask.

For older versions of brew, use:

brew cask uninstall --force [app]
Sybil
  • 3,937
  • 14
  • 48
  • 81
Gabe
  • 708
28

And unless you want the preferences lying around you can also do:

brew cask zap [your cask]
Houen
  • 381
6

In 2022, you can use:

brew uninstall --zap firefox

According to the documentation:

The zap stanza describes a more complete uninstallation of files associated with a Cask.

[...]

zap stanzas may remove:

Preference files and caches stored within the user’s ~/Library directory. Shared resources such as application updaters. Since shared resources may be removed, other applications may be affected by brew uninstall --zap. Understanding that is the responsibility of the end user.

Kwadz
  • 421
  • The command you specified doesn't include the word cask. Was this intentional? I have a package that does not appear in the list engendered by executing brew list, but only in the one engendered by executing brew cask list. Will the command specified in your answer uninstall it properly? Or should I add the word cask somewhere? – Evan Aad Nov 06 '22 at 06:18
  • Yes it is intentional, the documentation states: "The zap stanza describes a more complete uninstallation of files associated with a Cask." – Kwadz Nov 06 '22 at 23:56
0
  brew rmdeps

or

  brew rmtree

See: Uninstall / remove a Homebrew package including all its dependencies

It is possible that if the user updated the application manually and not using brew that it will have to be uninstalled manually.

You can check and see if there are any receipts in your Receipts folder:

 ls /private/var/db/receipts

and use the application's receipt .bom file and lsbom to Trash all files installed by the application as described here: Uninstall applications installed from packages Install

Homebrew seems to be taking the world by storm, according to Homebrew enthusiasts. I find Homebrew to be more or less incomplete, with barely any support, and has ambitions beyond its capability, perhaps because it is still in its infancy, or perhaps because it attempts to compete with a fully mature, complete, fully supported, end to end source and binary package management solution for OS X, i.e. MacPorts

chillin
  • 2,837
  • 2
  • 18
  • 32