brew-cleanup
Remove outdated downloads and old package versions
TLDR
Remove outdated downloads and old versions
SYNOPSIS
brew cleanup [options] [formula|cask]
DESCRIPTION
brew cleanup removes old versions of installed formulae and casks, deletes cached downloads, and frees disk space. It cleans the Cellar and the download cache.
Homebrew automatically performs cleanup after upgrades and periodically every 30 days unless HOMEBREWNOINSTALL_CLEANUP is set.
PARAMETERS
--dry-run, -n
Show what would be removed without removing--prune days
Remove cache files older than specified days-s
Scrub cache, including downloads for latest versions--prune-prefix
Remove empty directories from Homebrew prefix--formula
Treat all arguments as formulae--cask
Treat all arguments as casks
CACHE LOCATION
Default cache location: ~/Library/Caches/Homebrew (macOS)
View cache path: brew --cache
RELATED COMMANDS
brew autoremove
Remove unused dependenciesbrew upgrade
Should be followed by cleanup
CAVEATS
Old versions are automatically removed during brew upgrade. The -s flag removes even current version downloads which may need re-downloading later. Running without arguments cleans all installed packages.
SEE ALSO
brew(1), brew-upgrade(1), brew-autoremove(1)
