Identify the Homebrew installation you want to remove before running an uninstaller. Use that installation's exact prefix, inventory its packages, then review the official removal script and its dry-run output—not a remote one-liner pasted straight into a shell.
The crucial distinction is one package versus one entire Homebrew installation. Homebrew's official uninstall script warns that removing Homebrew removes installed packages and provides a --path option for choosing the prefix. On a Mac with more than one installation, guessing is the wrong starting point.
First decide what you actually want gone
- One command-line tool: use the selected Homebrew installation's formula uninstall command after checking dependents.
- One graphical app installed as a cask: review that cask's removal behavior, then use cask uninstall. You do not need to remove Homebrew itself.
- Old Intel-era Homebrew, keeping the Apple Silicon installation: inventory both and explicitly target the old prefix.
- All Homebrew installations: handle each separately, with a separate inventory and backup decision. Do not treat the second installation as cleanup debris.
- Just downloaded installers and old versions: that is cache cleanup, not manager removal. Use the selected installation’s official cleanup documentation for that separate task; inventory project dependencies and local-only data before removing anything.
The formula/cask distinction and scoped uninstall commands are documented in the Homebrew manpage.
1. Find the active installation—and look for another one
Run these diagnostics in your usual terminal:
command -v brew
type -a brew
brew --prefix
brew --repository
The first command tells you what your shell currently resolves. type -a can expose other matches on your current search path. brew --prefix reports the active installation's prefix; it does not prove there are no other installations elsewhere.
The current Homebrew installation documentation identifies /opt/homebrew as the default Apple Silicon prefix. The official uninstall script also recognizes /usr/local as the Intel/default alternative and checks that location when handling an Apple Silicon migration. These are candidates to inspect, not permission to delete either directory.
In Finder, use Go > Go to Folder to inspect /opt/homebrew/bin and /usr/local/bin. If a brew executable exists in either, ask it directly:
/opt/homebrew/bin/brew --prefix
/usr/local/bin/brew --prefix
Run only the lines whose executables actually exist. A missing path is not an error you need to fix. If you used a custom prefix, inspect that too. Keep the exact returned paths in your notes.
For the rest of this guide, /opt/homebrew/bin/brew is an example of an explicitly selected installation. Substitute the actual absolute executable path you verified. Do not mix inventory from one installation with removal of another.
2. Inventory packages, services, and data before removal
For the installation you selected, record:
/opt/homebrew/bin/brew list --formula
/opt/homebrew/bin/brew list --cask
/opt/homebrew/bin/brew services list
These listing commands are documented in the Homebrew manpage. Copy their output into a private note outside the target prefix. Do this separately for a second installation if one exists.
A package list is not a data backup. Look specifically for databases, local servers, build tools, and commands used by your projects. For each service, determine where its real data lives and use the application's supported backup procedure. Preserve configuration and custom files under the selected prefix before manager removal. Do not assume that everything inside a package-manager directory can be regenerated.
If you want a reinstall manifest, Homebrew documents brew bundle dump with a --file destination in the manpage. Run it only with a new destination outside the removal paths, and do not use an overwrite flag casually. The manifest records installed state; it does not capture database contents, app documents, credentials, or a guaranteed byte-for-byte copy of every installed version.
After backups are complete, stop only the user services belonging to the installation you intend to remove. Homebrew documents brew services stop FORMULA, which stops the service and unregisters login startup. Substitute an inventoried formula and its exact brew executable. Stopping a service interrupts its clients; schedule that deliberately. If a service is managed system-wide, stop here and ask your Mac administrator rather than improvising a privileged command.
3. If it is only one package, keep Homebrew
Before removing a formula, check its installed dependents:
/opt/homebrew/bin/brew uses --installed YOUR_FORMULA
Replace YOUR_FORMULA with the package you identified. This checks Homebrew's dependency relationships, not every project script that might call the executable. Review both before proceeding.
When removal is intended, Homebrew documents brew uninstall --formula YOUR_FORMULA and brew uninstall --cask YOUR_CASK; use the selected absolute brew path. These are removal actions, not diagnostics. Casks can have application-specific uninstall steps, so inspect their documentation and back up app data first. Avoid force, dependency-bypass, and --zap options as a shortcut around a warning. The Homebrew manpage explains those options and the extra scope of cask zapping.
For an app's ordinary support files, the general Mac uninstall guide covers the bundle-ID matching task. That is separate from deciding which Homebrew prefix owns a package.
4. Review the official script before any execution
Open Homebrew's reviewed uninstall source at revision 35da6871c4be7d7fdab2fd505fb7fa667926a2a5. This was the repository's main commit when retrieved for this review; the revision URL fixes the reviewed bytes instead of following a mutable branch. Save the raw file from that same revision as uninstall.sh in a dedicated review folder outside both prefixes. Open and inspect that exact saved copy before invoking even its dry run. If you choose a newer revision, review it anew; this review does not cover future changes. Do not execute a downloaded script sight unseen, and do not pipe a remote response directly into a shell.
At this reviewed revision, the removal list includes the selected Cellar and Caskroom, Homebrew repository files and prefix markers, matching paths-file entries, and optional caches/logs. It also checks application-directory entries resolving into the Cellar, removes broken symlinks under the prefix, and removes empty subdirectories. This is broader than deleting bin/brew. Deleting Caskroom is not a guarantee that every cask's externally installed application, privileged helper, or personal data is removed; review the cask's documented uninstall flow separately. Inventory and preserve intentional custom files before approving any path in the plan.
The reviewed source supports:
--path=PATHto select the prefix.--dry-runto simulate removal without deleting installation files.--skip-cache-and-logsto omit cache and log removal.- Force and quiet options, which are not appropriate for a review-first workflow.
A pinned script does not freeze every input. Its fallback .gitignore can be fetched from mutable HEAD and affects construction of the removal list. A later removal can therefore differ from an earlier dry run even when the saved script is unchanged. Recheck the current plan and preserve anything newly included before proceeding. Also inspect whether your shell has inherited a nonempty NONINTERACTIVE variable: the reviewed script treats that as force mode. Use an interactive session with that variable unset and without --force; do not proceed if the expected confirmation is absent.
A dry run is not a zero-side-effect sandbox. The reviewed script creates a temporary directory and plan files, may download a fallback .gitignore, and routes some find/list operations through its administrator-access helper even in simulation mode. That helper checks administrator authorization and can prompt; the exit trap removes temporary files and invalidates the authorization timestamp. Target-deletion branches are skipped, but these side effects are not. Read those sections before running it. If that does not fit your permissions or managed-device policy, ask an administrator to review it; do not work around the restriction.
After reviewing the saved file, from its review folder, this is the prefix-specific simulation for a verified /opt/homebrew target:
/bin/bash ./uninstall.sh --dry-run --path=/opt/homebrew --skip-cache-and-logs
This is an example to adapt, not a command to run for an unverified target. Keeping cache and log removal out of the initial plan also avoids assuming that shared user-level locations belong only to the prefix being removed.
Read every proposed path. If it includes unexpected applications, shared locations, or files you cannot explain, stop. Once the plan matches your inventory and backups, follow the official script's reviewed interactive removal flow with the same explicit prefix. Do not suppress confirmation. This article intentionally provides no privilege-escalation recipe; permission errors require ownership and policy review, not a more forceful command.
5. Verify both what disappeared and what stayed
Open a fresh terminal and repeat command -v brew and type -a brew. If keeping another installation, run its absolute brew --prefix and package-list commands again. Compare with your earlier notes.
Review your shell startup files in a text editor. Remove only the brew shellenv initialization or PATH entry pointing to the installation you removed. Preserve the surviving installation's entries and unrelated shell configuration. Homebrew describes shellenv in its manpage.
Test a project or command you intended to keep. Do not delete the whole /usr/local directory: it may contain software from other installers. The official uninstaller itself explicitly avoids removing /usr/local wholesale. Leftover directories should be reviewed individually, not erased merely because the script reports them.
FAQ
Can Apple Silicon Macs have two Homebrew installations?
They can retain an old /usr/local installation alongside /opt/homebrew; the official uninstall script accounts for that migration case. Verify each existing brew executable and prefix rather than assuming your Mac has only the architecture-default installation.
Does uninstalling Homebrew remove its packages?
Yes—the official script warns that installed packages will be removed. Record formulae and casks first, and separately back up application data and configuration. A package list or Brewfile is not a database backup.
Does brew cleanup uninstall Homebrew?
No. Homebrew documents cleanup as removing items such as outdated downloads and old installed versions. Removing the manager is a separate workflow with broader consequences.
Is the official uninstaller's dry run completely read-only?
No. It simulates installation removal without deleting those files, but the reviewed source still uses temporary files and can perform metadata and administrator-access checks. Review the saved script before invoking it.
Why does brew still work after uninstalling one prefix?
A fresh shell may resolve a second Homebrew installation. Check type -a brew, then ask the remaining absolute executable for its prefix. A surviving installation is not proof that the targeted one was not removed.
Planned review tools; no download yet
SwoopByte Uninstaller is still in development. Its planned Homebrew support includes free toolchain detection and sizes, with removal in Pro. Join the Uninstaller waitlist if that review would be useful. For today's task, the essential safety step is still yours: identify the exact prefix and protect its data before removal.