What is ~/Library/Caches/Homebrew, and is it safe to delete?

~/Library/Caches/Homebrew holds installers and source files that Homebrew downloaded for packages it already installed, and it is safe to clear because Homebrew can download them again.

Shiva ChandraMaker of Clean House · · 2 min read
Short answer

Homebrew keeps the files it downloaded when installing or upgrading packages. They are not needed to run the installed tools. Run brew cleanup to remove old ones the supported way. Nothing installed breaks, and Homebrew downloads again if it needs a file. Verdict: Safe to clear.

Path
~/Library/Caches/Homebrew (run brew --cache to see your exact path)
What it is
Downloaded bottles, casks and source archives for packages Homebrew installed
Typical size
Often hundreds of megabytes to several gigabytes
Made by
Homebrew
Safe to delete?
Safe to clear Use brew cleanup rather than deleting by hand.
Comes back?
Yes. Homebrew downloads files again when it needs them.

What is in the Homebrew cache?

When you run brew install or brew upgrade, Homebrew downloads files and keeps them in this folder. Old versions of downloads pile up after upgrades. The installed packages themselves live elsewhere, in /opt/homebrew on Apple silicon Macs or /usr/local on Intel Macs, and are not part of the cache.

Is it safe to delete the Homebrew cache?

Yes. Homebrew's documentation says it removes old versions after upgrades and does extra cleanup periodically. Setting HOMEBREW_NO_INSTALL_CLEANUP turns the automatic cleanup off, which is why the cache can grow for some people. If the folder is empty, Homebrew just downloads again next time.

How do I clear it?

Close any running brew command, then use Homebrew's own tool.

brew cleanup
brew cleanup --prune=all

The first command removes old versions and stale downloads. The second also removes all cached downloads, regardless of age. To see your cache path and the size, run these.

brew --cache
du -sh "$(brew --cache)"

How do I stop it growing?

Leave automatic cleanup on, which is the default, and run brew cleanup now and then after big upgrades.

How Clean House handles it

Clean House lists this folder as Homebrew downloads: installers for things Homebrew already installed. It marks it Safe to clear, and says that Homebrew downloads again if needed. Clean House also recognizes Homebrew in Dev Desk.

Questions

How do I clear the Homebrew cache?

Run brew cleanup. For a deeper clean, run brew cleanup --prune=all.

Will brew cleanup break my installed apps?

No. It removes old versions and downloads, not the current installed packages.

Where is the Homebrew cache?

Run brew --cache. It is usually ~/Library/Caches/Homebrew.

Sources

  1. Homebrew Documentation: FAQ
  2. Homebrew Documentation: brew man page