I've installed packages in my macOS using Homebrew, and installed GUI apps using Homebrew Cask.
How could I update my extensions and packages?
I've installed packages in my macOS using Homebrew, and installed GUI apps using Homebrew Cask.
How could I update my extensions and packages?
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.
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
brew upgrade --cask karabiner-elements
brew update; brew upgrade --cask --greedy ; brew upgrade $(brew outdated | awk '{ print $1 }') ; brew cleanup
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