11

I've installed packages in my macOS using Homebrew, and installed GUI apps using Homebrew Cask.

How could I update my extensions and packages?

3 Answers 3

12

If you're only trying to upgrade one package:

brew upgrade package_name

All packages

brew update && brew outdated && brew upgrade && brew cleanup

Note, I had to add my own answer for this since I got here looking for just one, and noticed the top answer had brew upgrade --cask, while I got the following from here:

During 2020 the sub-commands of the cask command were gradually integrated into the core of Homebrew and were deprecated. The core commands now operate on both formulae and casks. To limit their scope to only formulae or casks add the --formula or --cask option to the command line.

The cask command has been completely removed from Homebrew in version 2.6.0, released in December 2020.

There is a unified flow now for both formulae and casks:

brew update
brew outdated
brew upgrade

The first command (brew update) gets from the Homebrew servers the information about the most recent versions of the available formulae and casks.

The second command (brew outdated) lists the outdated installed formulae and casks. Add --formulae or --casks to the command line to limit the command scope to formulae or casks. Add --greedy to the command line to include in its output the casks that are marked as "auto-updateable". This command is not needed. It can be used to see what programs will be upgraded before doing the actual upgrade.

The third command (brew upgrade) upgrades the packages listed by brew outdated. It also supports the options listed above for brew outdated and operates accordingly.

11

To have your packages and apps you just need to run these commands in your terminal:

brew update && brew upgrade && brew upgrade --cask && brew cleanup
3
  • It didn't upgrade karabiner-elements. Needed to run brew upgrade --cask karabiner-elements
    – rofrol
    Commented Mar 9, 2022 at 12:43
  • 2
    Might be overkill but I use: brew update; brew upgrade --cask --greedy ; brew upgrade $(brew outdated | awk '{ print $1 }') ; brew cleanup
    – da4
    Commented Sep 13, 2023 at 21:20
  • "Just" need to enter that? 😆 There's no way I'm going to remember such a long chain of commands.
    – Simon East
    Commented Aug 27 at 2:37
-1

For updating casks specifically, I’d recommend brew cu. It can detect whether an app has auto-update or not, and you can prevent updating of certain apps.

YOU NEED TO INSTALL THE COMMAND.
Install with: brew tap buo/cask-upgrade

2
  • No such command on brew 4.0.4
    – kontur
    Commented Jun 23, 2023 at 9:32
  • Did you try installing it with the tap? Commented Jun 24, 2023 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .