This script helps you update Homebrew and list outdated applications on your macOS. It also checks for available software updates and outdated macOS apps from the App Store.
Make sure you have mas
(Mac App Store command line interface) installed. You can install it using Homebrew:
brew install mas
The script performs the following tasks:
-
Finding available macOS software updates:
softwareupdate -l
This command lists all available software updates for macOS.
-
Finding outdated macOS Apps:
mas outdated
This command lists all outdated applications installed via the Mac App Store.
-
Updating Homebrew:
brew update
This command updates Homebrew to the latest version.
-
Upgrading Homebrew packages:
brew upgrade
This command upgrades all installed packages to their latest versions.
-
Cleaning up Homebrew:
brew cleanup
This command removes outdated versions of installed formulas and clears the cache.
#!/bin/zsh
printf "\e[1;33m%s\e[m
" '==> Finding available macOS software'
softwareupdate -l
printf "\e[1;33m%s\e[m
" '==> Finding macOS Apps'
mas outdated
printf "\e[1;33m%s\e[m
" '==> brew update'
brew update
printf "\e[1;33m%s\e[m
" '==> brew upgrade'
brew upgrade
printf "\e[1;33m%s\e[m
" '==> brew cleanup'
brew cleanup
Copy and paste the script into a file, for example update_brew.sh
, and make it executable:
chmod +x update_brew.sh
Then, you can run the script:
./update_brew.sh