How to remove outdated installed versions of Homebrew packages in MacOS?

The cleanup (brew cleanup) command will remove outdated installed package versions. To affect a particular package/formula, you may supply a formula name like so: brew cleanup $FORMULA. 

brew cleanup only cleans outdated package versions if you have the newest version installed, so first brew upgrade then brew cleanup

brew upgrade
brew cleanup

It saved me 5GB at /usr/local/


Discover more from Juzhax Technology

Subscribe to get the latest posts sent to your email.