How to uninstall Homebrew packages safely on macOS

Homebrew makes installing easy and uninstalling surprisingly subtle. Remove the wrong formula and something else stops working; remove a cask and its preferences can linger for years. Here is the careful path.

Updated 2 November 2026 · 7 minute read

1. Find the exact package name

Homebrew has two kinds of packages, and they use different commands:

# command-line tools and libraries
brew list --formula

# GUI applications installed as casks
brew list --cask

A name may appear in both lists, but they are different packages. If you are unsure which one you have, ask Homebrew:

brew info --formula ffmpeg
brew info --cask iterm2

The first line of brew info tells you whether the package is installed, its version and its path. Use the exact name from that output; openssl, openssl@3 and openssl@4 are different formulae.

2. Check what depends on it

This is the step most guides skip. Before removing a formula, ask which installed packages require it:

brew uses --installed ffmpeg

If the output is empty, nothing else currently installed depends on it. If it names packages, removing ffmpeg will break them, and Homebrew may refuse the uninstall for good reason.

For the inverse view — everything a package pulls in — use:

brew deps --installed --tree ffmpeg

Casks do not have a formula dependency graph. For a cask, the main question is whether the application is still in use, and whether you want to remove its preferences and caches too.

3. Uninstall the package

For a formula:

brew uninstall ffmpeg

For a cask:

brew uninstall --cask iterm2

Homebrew will remove the package's files and leave your own documents alone. If the package is required by something else, read the warning rather than reaching for --ignore-dependencies. That flag is a way to create a broken installation, not a way to clean up.

Do not use --ignore-dependencies to force a removal. Remove or replace the dependent package first, or keep the library. A broken dependency is harder to diagnose than a few megabytes of disk.

4. Remove dependencies that are no longer needed

When you uninstall a formula, its dependencies usually stay behind. Homebrew can list the ones that no installed formula needs:

brew autoremove --dry-run

Read the list before removing anything. A library can be unused by Homebrew and still be used by a language runtime, a Python virtual environment, or a tool installed outside Homebrew.

If the list looks right:

brew autoremove

brew leaves is a useful second opinion: it lists formulae that are not dependencies of another formula. That is usually closer to "things I chose to install" than a raw brew list.

5. Clean old versions and caches

Uninstalling a package does not always remove old versions or downloaded bottles. This is safe to run regularly:

brew cleanup --dry-run
brew cleanup

brew cleanup removes old versions of installed formulae and stale downloads. It does not remove a package you still have installed.

6. Decide about cask data

By default, uninstalling a cask removes the application but may leave preferences, caches and support files in ~/Library. If you want those gone too, Homebrew has a stronger option:

brew uninstall --cask --zap iterm2

Read the --zap warning carefully. It can delete settings, sessions, plugins and local data. Quit the application first, and back up anything you would miss. For most people, the default uninstall plus a manual look at ~/Library/Application Support and ~/Library/Preferences is the safer choice.

A safety checklist

  1. Confirm the exact name and whether it is a formula or a cask.
  2. Run brew uses --installed <name> before removing a formula.
  3. Quit the app before uninstalling a cask.
  4. Never use --ignore-dependencies to force a removal.
  5. Use brew autoremove --dry-run before removing dependencies.
  6. Treat --zap as a data-deleting operation, because it is one.
  7. When in doubt, keep the package. Disk space is cheaper than a broken toolchain.

Want the dependencies and sizes in one view?

Dronagiri is a free, open-source macOS package manager that lists Homebrew formulae and casks alongside npm, pipx, Cargo, RubyGems and Go packages. It separates your tools from dependencies, shows real disk size and last-used evidence, and asks twice before removing anything.

Install Dronagiri

FAQ

Does brew uninstall delete my files?

It removes the package's own files. It does not delete your documents, projects or databases. Cask uninstalls may leave preferences and application data unless you use --zap.

Why does Homebrew refuse to uninstall a formula?

Something installed still depends on it. Run brew uses --installed <formula>, then remove or replace the dependent package first. Do not force it with --ignore-dependencies.

How do I remove all unused Homebrew dependencies?

Run brew autoremove --dry-run, review the list, then run brew autoremove. It only removes formulae that no installed formula needs, but review it anyway if you use tools outside Homebrew.

What is the difference between brew uninstall and brew cleanup?

brew uninstall removes a package. brew cleanup removes old versions and cached downloads of packages you still have installed.