@aknuds1 is right about brew cleanup
so I'll just add that I have an alias in my ~/.profile
that does all my brew-related cleanup, including cask update/cleanup
alias brewski='brew update && brew upgrade --all && brew cleanup; brew doctor'
I end with brew doctor
to make sure all packages are correctly symlinked, e.g., awscli
seems to have a problem with this on the regular so I constantly have to unlink/relink. Hope this helps.
EDIT: As it was pointed out to me in the comments, brew cask
functionality has been merged into the homebrew core. These commands were also throwing errors, so references to brew cask
have been deleted.
EDIT2: As I run this daily, I noticed the following comment today. I've updated the command accordingly
Warning: We decided to not change the behaviour of `brew upgrade` so
`brew upgrade --all` is equivalent to `brew upgrade` without any other
arguments (so the `--all` is a no-op and can be removed).