This article continues our series on the common commands every Mac admin should know. Check out the previous articles in this series to learn how to:
- Enable SSH to access a remote Mac’s shell securely
- Change your computer name, hostname, and local hostname
- Bind a Mac to Active Directory
- Logoff, restart, or shutdown a macOS device
Mac admins who manage multiple computers across the network will need to regularly install software updates on those computers. With this in mind, it is crucial for admins to learn how to install macOS software updates remotely and efficiently. We will explore how to do that using the terminal app in this article.
Why Install macOS Software Updates Remotely?
As an IT admin, when you manage multiple Macs in a network, you are responsible for ensuring they run smoothly and securely. You cannot assume that end users will install software updates in a timely fashion, nor can you expect users to know when there is a situation that warrants an immediate critical software update.
Additionally, installing software updates manually on each individual computer is time-consuming. Taking all of this into consideration, it becomes the mandate of IT admins like yourself to understand how to deploy macOS software updates remotely and en masse. A good way to do this is to run
softwareupdate commands in the terminal app.
To execute the
softwareupdate command on macOS to deploy updates remotely, there are a couple requirements:
- SSH must be enabled on the client workstations.
- The account you intend to use to manage the software updates must have admin level privileges on each Mac.
How to Install macOS Software Updates Remotely via Terminal
Invoking the software update tool will cause macOS to install all or specific software updates depending on the arguments used. In this section, we will explore different
The most common arguments you can use with
softwareupdate include the following:
–-list: This will list all the software updates available for installation after checking the update catalog.
–-install: Installs the updates. This can be used with additional arguments as follows:
--recommended: Use this argument to install only updates marked as recommended by Apple.
--all: Use this argument to install all the available updates, whether critical or not.
--download: This argument will download pending updates to the target Mac but not install any of the updates.
Now, let’s get started by launching the terminal app. Simply search “terminal” using the Spotlight search option on your computer or navigating through Applications > Utilities > Terminal.
How to Check for Available Updates
Before installing a software update, you must establish that there is a macOS update available for installation. To get a list of all available updates, run the following command:
sudo softwareupdate -l OR
sudo softwareupdate --list
We executed the command and it found specific software updates available for us to download or install. As shown in Figure 1, there are two updates available on our network — macOS Catalina 10.15.7 Update with a size of 4667570K (approximately 4.67GB) and Device Support Update with a size of 191029K (approximately 191MB). Also, it can be seen that both updates are recommended by Apple.
If there is no software update available for installation, you will get a “No new software available” response as shown in Figure 2.
Install the Updates
- To install all the updates, run the following command:
sudo softwareupdate -i -a OR
sudo softwareupdate --install --all
- To install only the updates recommended by Apple, run the following command:
sudo softwareupdate -i -r OR
sudo softwareupdate --install --recommended
- To install only specific updates, run the command below:
sudo softwareupdate -i ‘<NAME of update exactly as it appears in the list of updates>’
For example, we can choose to install only the macOS Catalina 10.15.7 Update by running the following command:
sudo softwareupdate -i ‘macOS Catalina 10.15.7 Update’
Download the Updates Without Installing
- To download all the updates, run the following command:
sudo softwareupdate -d -a OR
sudo softwareupdate --download --all
- To download only the updates recommended by Apple, run the following command:
sudo softwareupdate -d -r OR
sudo softwareupdate --download --recommended
- To download only specific updates, run the command below:
sudo softwareupdate -d <NAME of update exactly as it appears in the list of updates>
For example, we can choose to download only the macOS Catalina 10.15.7 Update by running the following command:
sudo softwareupdate -d macOS ‘Catalina 10.15.7 Update’
Get More Information on softwareupdate Command
Run the command below to get more information about all the
softwareupdate command arguments. It will provide information about all the arguments you can use to manage your updates. Refer to Figure 3.
sudo softwareupdate --help
In this article, we explored how you can install macOS software updates remotely using the
softwareupdate command via the terminal app. If you install an update that requires the computer to restart, the terminal app will let you know.
To better manage user notifications, automatically enforce updates, and monitor update statuses across your fleet, you may want to consider implementing a patch management solution like JumpCloud.
With the JumpCloud Directory Platform in place, IT admins can automate and efficiently roll out patches for both macOS and Windows devices from a single pane of glass view, no commands required. Learn more about our directory-integrated patch management capabilities here.