How to uninstall Homebrew on a Mac, with a dry run first
Homebrew's own uninstall script, the dry run that shows what it removes, and the apps it leaves behind. On our Mac: 10 GB, 153 tools and 9 apps.
How do I uninstall Homebrew on a Mac?
Run Homebrew's own uninstall script from Terminal. Run it once with --dry-run first, which lists what it would remove and removes nothing:
curl -fsSLO https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh
/bin/bash uninstall.sh --dry-runRead the list. When you are ready, run /bin/bash uninstall.sh without --dry-run. The script also has --skip-cache-and-logs to leave the download cache in place, and --path for a Homebrew installed somewhere other than the default.
What gets removed when you uninstall Homebrew?
Everything under Homebrew's folder, which is every tool you installed with brew. On our Mac that meant:
| What | Here |
|---|---|
/opt/homebrew (Apple silicon) or /usr/local (Intel) | 10 GB |
Command line tools (brew list --formula) | 153 |
Apps installed as casks (brew list --cask) | 9, which Homebrew stops tracking (see below) |
Download cache, ~/Library/Caches/Homebrew | 291 MB |
Three Pythons, a second Node, OpenSSH and ollama on our Mac all came from Homebrew. Anything a project or script runs through /opt/homebrew/bin stops working.
Does uninstalling Homebrew remove apps installed with --cask?
No, and this surprises people. We read the uninstall script: it removes Homebrew's own folders, including the Caskroom where it records casks, but in Applications it only removes items that link back into Homebrew's Cellar. Cask apps are real copies, so Visual Studio Code, Alfred and the rest stay in Applications. So did our Java, which the zulu@17 cask installed into /Library/Java/JavaVirtualMachines. What changes is that nothing updates them any more. To remove a cask app properly, run brew uninstall --cask <name> for it before you uninstall Homebrew.
What should I check before uninstalling Homebrew?
- List what you have:
brew list --formulaandbrew list --cask. Save the output, or runbrew bundle dumpto write aBrewfileyou can reinstall from later withbrew bundle. - Look for things you rely on. Check
which -a python3 node java gitto see which of your tools resolve to/opt/homebrew. - Decide about the apps. Cask apps such as Visual Studio Code or Alfred stay after Homebrew goes, without updates. Uninstall the ones you do not want with
brew uninstall --caskwhile Homebrew is still there, and reinstall the ones you keep from their own sites so they update themselves.
Does uninstalling Homebrew remove Xcode Command Line Tools?
No. The Command Line Tools are Apple's, in /Library/Developer/CommandLineTools, and the uninstall script leaves them alone. Apple's git and python3 in /usr/bin keep working afterwards.
Do I need to uninstall Homebrew to free space?
Usually not. brew cleanup removes old versions and the download cache, and brew autoremove removes tools nothing needs any more. See what Homebrew's packages cost and the leftovers casks leave behind.
Common questions
What is the command to uninstall Homebrew?
Download Homebrew's uninstall.sh from its install repository and run /bin/bash uninstall.sh --dry-run to see what it would remove, then /bin/bash uninstall.sh to remove it.
Does uninstalling Homebrew delete apps installed with brew install --cask?
No. The apps stay in Applications, and Homebrew stops updating them. Remove the ones you do not want with brew uninstall --cask before uninstalling Homebrew.
Can I reinstall everything after uninstalling Homebrew?
Yes, if you saved a Brewfile with brew bundle dump before uninstalling. After reinstalling Homebrew, brew bundle installs everything in it.