How to uninstall Homebrew apps and packages on a Mac
By Vishva Variya · Updated · 5 min read
Short answer
Run brew uninstall with the name. For an app installed as a cask, add --cask, and add --zap to also remove the preferences and caches the cask lists. brew autoremove then removes dependencies nothing needs any more, and brew cleanup deletes old versions and cached downloads. Dragging a Homebrew app to the Trash leaves Homebrew’s record behind.
What did I install with Homebrew?
brew list --cask lists the apps (casks) and brew list --formula the command-line packages (formulae). The formula list includes every dependency, so this shorter list of formulae nothing else depends on, and that you installed yourself, is usually the one you want:
brew leaves --installed-on-requestHow do I uninstall a Homebrew app (cask)?
- 1Quit the app.
- 2Run brew uninstall --cask followed by the cask name, for example brew uninstall --cask firefox.
- 3To also remove the settings, caches and support files the cask knows about, add --zap.
- 4Already dragged the app to the Trash? brew uninstall --zap --force still runs the zap steps for a cask that’s no longer installed.
brew uninstall --cask --zap firefox--zap never runs unless you ask for it. It removes preference files and caches in ~/Library and can also remove shared resources, such as an updater other apps from the same developer use. It doesn’t remove files you created yourself.
How do I uninstall a formula and the dependencies it brought?
- 1Run brew uninstall followed by the formula name. Homebrew refuses if another installed formula still depends on it.
- 2Run brew autoremove --dry-run to see which dependencies are no longer needed.
- 3Run brew autoremove to uninstall them.
brew uninstall and brew cleanup already remove unused dependencies on their own unless HOMEBREW_NO_AUTOREMOVE is set. --ignore-dependencies forces an uninstall anyway, but it leaves whatever depended on it broken.
Where does Homebrew keep its files?
- Its install prefix: /opt/homebrew on Apple silicon Macs, /usr/local on Intel Macs. brew --prefix prints yours.
- Its download cache: ~/Library/Caches/Homebrew. brew --cache prints the exact path.
- Old versions of upgraded formulae, until cleanup removes them.
brew cleanup removes old versions of installed formulae, stale lock files and downloads more than 120 days old. Add -n to preview it, --prune followed by a number of days to set your own age limit, or -s to scrub the cache including downloads for the latest versions. Homebrew also runs a cleanup on its own every 30 days unless HOMEBREW_NO_INSTALL_CLEANUP is set.
How do I remove a tap?
A tap is an extra formula repository you added with brew tap. Once you’ve uninstalled what came from it, remove it with brew untap followed by its name, such as user/repo. brew untap --force uninstalls the tap’s formulae and casks first, then removes it.
Removing Homebrew apps with Peekaboo
Peekaboo’s App Uninstaller marks apps that came from Homebrew as “Installed by Homebrew” and removes them with Homebrew itself, so brew doesn’t go on thinking they’re installed. The leftovers you pick in your Library go to the Trash as with any other app. Homebrew deletes the app for good rather than to the Trash, so this needs Settings › Cleanup › Allow permanent removal turned on, and Peekaboo asks you to confirm each time.
- 1Open the App Uninstaller.⇧⌘X
- 2Pick an app tagged “Installed by Homebrew” and review the leftovers found with it.
- 3Choose Uninstall with Homebrew… and confirm. The leftovers go to the Trash.
- 4Changed your mind about the leftovers? Put the last cleanup back.⌥⌘Z
Questions
Can I just drag a Homebrew app to the Trash?
- It removes the app, but Homebrew still lists the cask as installed. Run brew uninstall --cask with its name as well, so Homebrew’s list matches what’s on your Mac.
Is brew uninstall --zap safe?
- It only removes files the cask lists, and never files you created. But zap can remove shared resources, so other apps from the same developer may be affected. Leave it off if you’re unsure.
Does brew uninstall remove dependencies?
- Yes, by default it also removes formulae that were only installed as a dependency and are no longer needed, unless HOMEBREW_NO_AUTOREMOVE is set. brew autoremove does the same on demand.
How do I uninstall Homebrew itself?
- Homebrew’s FAQ says to run the uninstall script from the Homebrew/install repository on GitHub. Uninstall the apps you no longer want first, while brew can still remove them cleanly.