Homebrew upgrades itself to brew. And it looks like the maintainers have not implemented some daily-used commands like brew cleanup
.
So anyone knows how to delete outdated version of software automatically?
$ brew
Example usage:
brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]
Troubleshooting:
brew config
brew doctor
brew install -vd FORMULA
Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Formula-Cookbook.md
Further help:
man brew
brew help [COMMAND]
brew home
Best Answer
The command you want is
cleanup
-- runningbrew cleanup
will remove packages that are on disk, but no longer installed.For example:
I have a Monday morning regimen of:
That brings me up to date on Homebrew, then all of my installed brews and then it frees up disk space by removing old brews that are no longer referenced. For brews that I need to keep at a specific version, I use
brew pin
to hold them there so I can still run this simple, three command, chain to update everything else around the pinned packages.