Upgrade ALL your Brew packages

Having slipped down the rabbit hole of attempting to install every application onto my mac using terminal via Homebrew or mas, I am now faced with the question of how do I update those applications?

Upgrade ALL your Brew packages

Having slipped down the rabbit hole of attempting to install every application onto my mac using terminal via Homebrew or mas, I am now faced with the question of how do I update all of those applications?

Solution

brew update && brew list --casks | xargs brew install --cask && brew cleanup
brew update && brew list | xargs brew install && brew cleanup

source: https://gist.github.com/mikker/631106/450...

Caveat-1

The onedrive agent often causes an error
Error: onedrive: Unsatisfied requirements failed this build.
and... therefore the command is not fully executed, the all important
brew cleanup is skipped.

Solution-1

It is possible to exclude specific packages from attempted upgrade

brew update && brew list | grep -v 'onedrive' | xargs brew install && brew cleanup

Specifically for onedrive I found it necessary to upgrade the --cask

brew upgrade --cask onedrive

Usual dislaimer, execute this code at your own risk, I do not accept any responsibility for damage or inconvenience caused by executing any of this code in your environment