How to Uninstall Homebrew Packages on Mac
Need to uninstall a Homebrew package on your Mac? Whether you're freeing up disk space, removing software you no longer need, or cleaning up your development environment, this guide covers everything you need to know.
We'll show you how to uninstall both formulae (command-line tools) and casks (GUI applications), plus how to clean up leftover dependencies.
Quick Answer: The Basic Uninstall Command
To uninstall any Homebrew package, open Terminal and run:
brew uninstall package-name
For example, to uninstall Node.js:
brew uninstall node
That's it for simple cases. Read on for more advanced scenarios.
Step-by-Step: Uninstalling Homebrew Packages
1. Find the Package Name
First, list all your installed packages to find the exact name:
# List all formulae (CLI tools)
brew list --formula
# List all casks (GUI apps)
brew list --cask
2. Uninstall the Package
Run the uninstall command with the package name:
# Uninstall a formula
brew uninstall wget
# Uninstall a cask
brew uninstall --cask visual-studio-code
3. Remove Unused Dependencies
Packages often install dependencies. Remove orphaned ones with:
brew autoremove
4. Clean Up Old Versions
Free up disk space by removing old package versions and cache:
brew cleanup
How to Uninstall Casks (GUI Applications)
Casks are macOS applications installed via Homebrew (like Chrome, VS Code, Slack). To uninstall them:
brew uninstall --cask app-name
Examples:
# Uninstall Google Chrome
brew uninstall --cask google-chrome
# Uninstall Slack
brew uninstall --cask slack
# Uninstall Docker
brew uninstall --cask docker
Note About Cask Leftovers
Some apps leave behind preferences or data in ~/Library. Homebrew removes the app itself, but you may want to manually delete remaining files in ~/Library/Application Support/, ~/Library/Preferences/, and ~/Library/Caches/.
Force Uninstall (When Normal Uninstall Fails)
If a package refuses to uninstall due to dependencies, you can force it:
brew uninstall --force package-name
Or to ignore dependency checks:
brew uninstall --ignore-dependencies package-name
Use With Caution
Force uninstalling can break other packages that depend on it. Only use this if you're sure nothing else needs the package.
Uninstall Multiple Packages at Once
You can uninstall several packages in one command:
brew uninstall package1 package2 package3
For example:
brew uninstall wget curl httpie
How to Find and Remove Large Packages
Want to free up disk space? Find your largest packages:
# See disk usage for all packages
brew list --formula | xargs -I {} sh -c 'echo "$(brew --cellar)/{}"; du -sh "$(brew --cellar)/{}"' 2>/dev/null | sort -h
Complete Cleanup: Remove Everything Unused
For a thorough cleanup after uninstalling packages:
# Remove orphaned dependencies
brew autoremove
# Clean old versions and cache
brew cleanup
# Remove all cache (more aggressive)
brew cleanup --prune=all
How to Completely Remove Homebrew
If you want to uninstall Homebrew itself and all packages:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
This removes Homebrew, all installed packages, and related files.
Troubleshooting Common Issues
"Error: Refusing to uninstall because it is required by..."
Another package depends on this one. Either uninstall the dependent package first, or use --ignore-dependencies (not recommended).
"No such keg" error
The package isn't installed. Check the exact name with brew list.
Cask still appears after uninstall
The app might be running. Quit it first, then try uninstalling again.
Summary
Here are the essential commands for uninstalling Homebrew packages:
# Uninstall a package
brew uninstall package-name
# Uninstall a cask
brew uninstall --cask app-name
# Remove orphaned dependencies
brew autoremove
# Clean up old versions
brew cleanup