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鈥檚 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.
Requirements
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 softwareupdate
arguments.
The Arguments
The most common arguments you can use with softwareupdate
include the following:
-l
OR鈥-濒颈蝉迟
: This will list all the software updates available for installation after checking the update catalog.-i
OR鈥-颈苍蝉迟补濒濒
: Installs the updates. This can be used with additional arguments as follows:-r
OR–recommended
: Use this argument to install only updates marked as recommended by Apple.-a
OR–all
: Use this argument to install all the available updates, whether critical or not.
-d
OR–download
: This argument will download pending updates to the target Mac but not install any of the updates.
Launch Terminal App
Now, let鈥檚 get started by launching the terminal app. Simply search 鈥渢erminal鈥 using the Spotlight search option on your computer or navigating through Applications > Utilities > Terminal.
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 鈥淣o 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 鈥榤acOS 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 鈥楥atalina 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
Wrap Up
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 黑料海角91入口.
With the 黑料海角91入口 Directory Platform in place, IT admins can automate and efficiently roll out macOS patches and Windows patches from a single pane of glass view, no commands required. Learn more about 黑料海角91入口’s Patch Management solution.