Skip to content

Homebrew installs more than you asked for, and keeps it all

The packages you installed pull in dependencies that stay after you remove them. What brew autoremove finds, and where the rest of the size is.

5 min read

Homebrew is two separate storage problems and the advice online only ever covers one of them. The cache of downloaded bottles is well known. The installed packages themselves are usually larger, and nothing suggests removing any of them.

See what is actually installed

du -sh /opt/homebrew 2>/dev/null
du -sh /opt/homebrew/Cellar/* 2>/dev/null | sort -h | tail -20

The Cellar is where the packages live, one folder per formula, and possibly more than one version inside each. The list is usually a surprise, because most of it is dependencies rather than things you asked for.

Dependencies nothing needs any more

When you remove a package, Homebrew leaves the dependencies it installed for it, because something else might need them. Often nothing does:

brew autoremove --dry-run
brew autoremove

The dry run lists exactly what would go. On a Mac that has had Homebrew for a few years this is regularly a dozen formulae, several of them large, and every one of them is something you never chose to install.

What you asked for, as opposed to what came along

brew leaves
brew list --formula | wc -l

brew leaves prints only the formulae that nothing else depends on, which is the list of things you actually installed. Compare its length with the total. The difference is the dependency tree, and it explains most of the Cellar.

Old versions, and the cache

brew cleanup --dry-run
brew cleanup -s

brew cleanup removes superseded versions and clears the download cache, and the -s flag makes it clear the cache more aggressively. That is the part covered in the Homebrew cache guide, which also explains why the space sometimes does not appear where you expect.

Casks are applications

Anything installed with brew install --cask is an ordinary Mac application in your Applications folder, and it counts there rather than in the Cellar. Removing one with brew uninstall --cask removes the app, and leaves the same support files behind that any uninstall leaves.

Common questions

How much space does Homebrew use on a Mac?

On a working Mac measured in September 2026, /opt/homebrew was 7.9 GB, most of it installed packages in the Cellar rather than cache. The download cache is a separate and usually smaller number that brew cleanup clears.

What does brew autoremove do?

It removes formulae that were installed only as dependencies of something you have since uninstalled, and that nothing else needs. Running it with --dry-run first lists exactly what would go, which is often a dozen packages you never chose.

What is the difference between brew cleanup and brew autoremove?

cleanup removes old versions of packages you still have and clears the download cache. autoremove removes whole packages that nothing depends on any more. They free different space and both are worth running.

Does brew cleanup remove installed packages?

No. It removes superseded versions and cached downloads, leaving current packages in place. If the Cellar is what is large, autoremove and uninstalling formulae you no longer use are the commands that help.

Read next