Updating and Upgrading Brew Cask Apps via Command Line Interface

If you’re a macOS user who relies on Homebrew and Brew Cask for managing software packages and applications, keeping everything up to date is crucial. This guide outlines how to update and upgrade Brew Cask apps through the command line interface (CLI). Follow the steps below to ensure that your software is always current.

Prerequisites

Before you start updating and upgrading your Brew Cask apps, make sure you have already updated Homebrew itself. To do this, open your terminal and run:

1
brew update

This command fetches the latest package information from the Homebrew repository.

Updating Brew Cask Apps

To update your Brew Cask apps, you need to perform two steps:

  1. Upgrade Brew: Ensure that your Homebrew installation is up to date by running:

    1
    
    brew upgrade

    This command will update Homebrew and all its formulas.

  2. Update Brew Cask Apps: After upgrading Homebrew, you can proceed to update Brew Cask apps. First, list the outdated Cask apps with:

    1
    
    brew cask outdated --greedy --verbose | grep -v '(latest)' | awk '{print $1}'

    This command lists the outdated apps, excluding those already at the latest version.

    Finally, update these outdated apps by using the xargs command in combination with brew cask reinstall:

    1
    
    brew cask outdated --greedy --verbose | grep -v '(latest)' | awk '{print $1}' | xargs brew cask reinstall

    This command will reinstall the outdated apps, effectively updating them to their latest versions.

By following these steps, you’ll ensure that both Homebrew and your Brew Cask apps are regularly updated, keeping your macOS software ecosystem current and secure.

Remember to periodically run these commands to stay up to date with the latest software releases and security patches for the applications installed via Brew Cask.

0%