If you administer a number of Macs, running common tasks through the command line can reduce your maintenance workload. Using a combination of system commands and open-source repositories, you can update both macOS software and Mac App Store software using Terminal.
Update macOS Software Using Terminal
You can update built-in macOS software using the softwareupdate
command in Terminal.
1. Open Terminal (Application/Utilities/Terminal.app).
2. Type the following command and press “Enter:”
softwareupdate -l
This will list all the macOS software updates that are currently available for your system.
3. Wait for a moment while it searches the macOS servers for updates.
4. If updates are available, softwareupdate will tell you which updates are available. If no updates are available, you’ll be returned to the command prompt.
5. To install all available updates, type the following command and press “Enter:”
sudo softwareupdate -ia --verbose
6. Type your password when prompted and press “Enter.”
7. The update process will now run, displaying each program’s progress as it is updated.
8. When the update process is finished, you’ll be returned to the command prompt.
Softwareupdate Flags
- The
--verbose
flag is optional, but it will give live status reports as updates are installed. If you have a lot of updates to process, this flag will keep you abreast of the current status. - The
-i
flag stands for “install” and will begin the installation process for selected apps - The
-a
flag stands for “all.” This will install all available updates. - The
-r
flag stands for “recommended.” For example,softwareupdate -ir
will install only “recommended” updates. - The
-h
flag stands for “help” and will reveal all available commands. - To install just one update, use
softwareupdate -i [package name]
For example,
softwareupdate -i RemoteDesktopClient-3.9.2
will install only the RemoteDesktopClient 3.9.2 update. - To ignore specific updates, use the
--ignore
flag. For example:softwareupdate --ignore RemoteDesktopClient-3.9.2
will hide the 3.9.2 update of RemoteDesktopClient. You’ll be alerted when a new update is available.
Update Mac App Store Software Using Terminal
By default, macOS does not contain a command line utility for updating apps from the Mac App Store. However, you can install Dmitry Rodionov’s mas utility to add this functionality to your command line.
1. Open Terminal (Application/Utilities/Terminal.app).
2. If you don’t already have the Homebrew package manager installed, you’ll need to get it. Install Homebrew using the Terminal command below:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You can also follow our guide for getting set up with Homebrew.
3. Use the following command to install mas-cli from the Homebrew database:
brew install mas
4. When the installation is complete and you have your command prompt back, you can type in mas
to see a list of all available mas commands.
5. Type the following command to see a list of installed Mac App Store apps. There might be a few of them.
mas list
6. Type the following command to see all apps with updates available:
mas outdated
7. Type the following command to update all apps with updates available:
mas upgrade
8. mas will run through the upgrade process for each app.
9. When the update process is complete, you’ll be returned to the command prompt.
Conclusion
If you need to update the built-in macOS software, or even macOS itself, you can use softwareupdate
to complete that process from the command line. If you need to update apps from the App Store, you can install mas
to get that done via Terminal.
Our latest tutorials delivered straight to your inbox