DiegoC.

Updating all your casks via Homebrew on macOS

18/01/2020 · Less than 1 minute of reading

I’m addicted to maintaining all my programs updated, and the best way to do this in macOS is with the help of dependency managers like Homebrew, when using it to install our software you can write small scripts to automate this process.

In Homebrew the command to update all software is brew upgrade --cask but it’s not always successful to find updates for all applications, to fix this problem we must execute this upgrade command for every installed software.

Here’s the tip! To avoid having to run upgrade to each item manually, run this command in your terminal:

for cask in $(brew list --cask); do brew upgrade --cask $cask; done;

With this script, we use the for to iterate in each item returned by the brew list --cask command and force the update.