How to Uninstall Homebrew on Mac (Complete Guide)
This guide walks you through completely removing Homebrew from your Mac, including the packages it installed, its directories, and its shell configuration changes. You’ll need admin access to your Mac, and it’s wise to back up any data you care about before starting, as the process permanently deletes files.
What You’ll Need
- Admin user account on your Mac
- Terminal app (found in /Applications/Utilities/)
- About 10-15 minutes of time
- Optional: a list of installed packages if you want to reinstall them later
Step-by-Step
- Open Terminal. You can find it in the Utilities folder inside Applications, or search for it with Spotlight (Cmd+Space).
- Run the official uninstall script. Homebrew provides an automated script that removes itself and most of its files. Paste this command and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" - Follow the prompts. The script will ask for confirmation. Type
ywhen prompted to continue. It may ask about removing the Homebrew directory; confirm withy. - Manually remove leftover files. The script doesn’t remove everything. Run these commands one by one to delete common leftover directories (they may not all exist, that’s fine):
sudo rm -rf /opt/homebrew(for Apple Silicon Macs)sudo rm -rf /usr/local/Homebrew(for Intel Macs)sudo rm -rf /Library/Caches/Homebrewrm -rf ~/Library/Caches/Homebrew - Clean up shell configuration. Homebrew adds lines to your shell profile (e.g.,
~/.zprofilefor zsh,~/.bash_profilefor bash). Open the file with a text editor:nano ~/.zprofile(or~/.bash_profile)
Look for lines containingHomebrewor/opt/homebrew/binand delete them. Save with Ctrl+O, Enter, then exit with Ctrl+X. - Remove the Homebrew user and group (optional). If you created a dedicated Homebrew user, delete it with:
sudo dscl . -delete /Users/homebrew
and for the group:sudo dscl . -delete /Groups/homebrew - Verify removal. Close and reopen Terminal, then run:
which brew
If nothing appears, Homebrew is gone. Also check that your shell prompt works normally.
Common Mistakes
- Skipping the uninstall script – Manually deleting folders without running the script can leave broken symlinks and configuration files behind.
- Forgetting shell profile cleanup – Leftover PATH entries can cause “command not found” errors for other tools.
- Deleting the wrong directories – Be careful with
/usr/localon Intel Macs; it contains other software too. Only remove the Homebrew subfolders. - Not checking for dependencies – Some apps installed outside Homebrew might rely on Homebrew-managed libraries. Uninstalling could break them.
Tips
- List your installed packages first: Run
brew listbefore uninstalling to save the list for later reinstallation. - Use the script as the primary method: It handles most cleanup automatically, reducing the chance of errors.
- Back up your shell profile: Copy
~/.zprofileto~/.zprofile.bakbefore editing, so you can restore it if needed. - Restart your Mac after uninstalling to ensure all processes and environment changes are cleared.
Troubleshooting
- Script fails with “curl: (7) Failed to connect” – Check your internet connection. If you’re behind a proxy, set the proxy in Terminal or download the script manually and run it with
bash uninstall.sh. - “Permission denied” errors – Ensure you’re using
sudofor system-wide directories and that you have admin rights. If you’re still stuck, try rebooting into Safe Mode (hold Shift during startup) and retry. - Homebrew still appears in PATH – The shell profile may still reference it. Re-edit your profile file and remove any remaining Homebrew lines. Then run
hash -rto refresh the command cache. - Other tools break after uninstall – Some tools like Node.js or Python may have been installed via Homebrew. Reinstall them using their official installers to restore functionality.
- “Operation not permitted” on macOS Catalina or later – Grant Terminal Full Disk Access in System Settings > Privacy & Security > Full Disk Access, then try again.
Frequently Asked Questions
Does uninstalling Homebrew remove the packages I installed with it?
Yes, the uninstall script removes all packages installed via Homebrew, along with their dependencies. If you want to keep any, back them up or reinstall them later manually.
Can I reinstall Homebrew after uninstalling?
Absolutely. Just run the official install script from the Homebrew website again. Your Mac will be clean, so the new installation will start fresh.
Will uninstalling Homebrew affect my other apps?
Possibly. Apps that depend on libraries installed by Homebrew might stop working. It’s best to check which apps rely on Homebrew before proceeding.
Do I need to delete the Homebrew user account?
Not necessarily. The uninstall script doesn’t remove the user, but it’s good practice to delete it if you created it specifically for Homebrew. It’s safe to leave it if you prefer.
What if I’m using an Intel Mac?
The process is the same, but the Homebrew installation directory is /usr/local/Homebrew instead of /opt/homebrew. Adjust the manual deletion commands accordingly.
Is there a way to uninstall Homebrew without the script?
Yes, but it’s more error-prone. You’d have to manually delete all Homebrew directories, remove symlinks, and edit your shell profile. The script is recommended for a thorough cleanup.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.