misonoteApp Center

Homebrew cache (~/Library/Caches/Homebrew): safe to delete?

Safe to deleteRegenerated automatically; Thermo deletes it outright.

Quit first: brew

Where it is

  • ~/Library/Caches/Homebrew

What it is

When you install or upgrade a formula or cask, Homebrew first downloads the bottle, source archive or app installer into its cache. The cache can also hold downloads for things you've since uninstalled.

Why it gets so big

Homebrew runs an automatic cleanup now and then, but it keeps recent downloads, and casks for big apps such as IDEs come with large installers. Frequent upgrades refill it between cleanups.

Is it safe to delete?

Yes. Installed formulae and apps live in the Cellar, the Caskroom and your Applications folder, not in the cache, so the only cost is re-downloading if you reinstall something. Let any running brew command finish first. Homebrew's cleanup command with the prune-all option empties the cache completely.

Tip

If the cache keeps growing, check that HOMEBREW_NO_INSTALL_CLEANUP isn't set in your shell profile, since it turns off the automatic cleanup.

See how much space it uses

du -sh "$HOME/Library/Caches/Homebrew" 2>/dev/null

Clean it with the tool’s own command

brew cleanup --prune=all

Delete it by hand

Run in Terminal. Deleting cannot be undone, so check the paths first.

rm -rf "$HOME/Library/Caches/Homebrew"/*