Check and Install Mac OS X Software Updates from Terminal
Want to update Mac OS software from the Terminal? You can check for available updates, ignore packages, and install any or all Mac OS X Software Updates directly from the command line.
To see what updates are available for a Mac, or to install a software update from the Terminal of Mac OS X, amongst many other options including how to ignore particular updates, you’ll use the ‘softwareupdate’ command line tool as we’ll instruct below.
Read on to learn about using the command line software update utility on the Mac.
How to Check For & Install Mac OS Software Updates from the Command Line
We’ll break this down into a few sections. First we’ll show you how to check for available software updates and get a list of all available Mac software updates from the command line. Then we’ll show you how to install software updates from the command line, including installing all updates, recommended updates, or a specific update.
As this is using the command line, you will be using the Terminal application, found in /Applications/Utilities/ on all Macs. If you’re unfamiliar with the command line, it’s probably better to simply install software updates from the Software Update system preference or the Mac App Store.
List All Available Mac Software Updates from Command Line
To get a list of available software updates, type the following command in the Terminal:
You will see a list of available updates.
Installing All Available Mac OS Software Updates from Terminal
You can then install all available software updates with the following command:
sudo softwareupdate -iva
The use of sudo is required to get superuser privileges to actually install the updates.
Install Recommended Updates Only from Terminal in Mac OS X
You can also install only the recommended updates with:
sudo softwareupdate -irv
Installing Specific Software Updates to Mac from Terminal of Mac OS X
You can also just install specific software updates by specifying the shorthand package name from the previous list retrieved from the softwareupdate tool, just point the command at a particular package and make sure the syntax matches up like so:
sudo softwareupdate -i iPhoneConfigurationUtility-3.2
We’ve discussed different but similar approaches to installing specific software updates this way before in the past, so this may be familiar to you already.
How to Ignore Specific Software Updates from Terminal in Mac OS X
If there are any available software updates you want to ignore, you can do so with the –ignore flag, pointed at the package you want to ignore, for example:
sudo softwareupdate --ignore iWeb3.0.2-3.0.2
What other software update commands are available in Terminal?
If you want to see all the available command line options for Software Update, just type:
Hit Return and you’ll see many other options for command line based software updates to MacOS, including how to set and clear the softwareupdate catalog, download but not install, cancel downloads, install, ignore, reset the ignore list, verbose mode, suspend options, pull logs from the softwareupdate daemon, and more, with the following output showing all options:
% softwareupdate -h
** Catalog Management:
Set the new catalog URL (requires privileges)
–clear-catalog Clear the catalog URL back to defaults (requires privileges)
** Manage Updates:
-l | –list List all appropriate update labels (options: –no-scan)
-d | –download Download Only
-e | –cancel-download Cancel a download
-i | –install Install
(label) … specific updates
-a | –all All appropriate updates
-r | –recommended Only recommended updates
–background Trigger a background scan and update operation
–ignore (label) … Ignore specific updates
–reset-ignored Clear all ignored updates
** Other Tools:
–suspend-background (on | off) Suspend background operations from occurring temporarily (uses –duration)
–duration (duration)) Optional duration in seconds to suspend background operations (defaults to 5*60 seconds)
–dump-state Log the internal state of the SU daemon to /var/log/install.log
–no-scan Do not scan when listing or installing updates (use available updates previously scanned)
-v | –verbose Enable verbose output
-h | –help Print this help
Optionally, you can use the softwareupdate man page:
The command line approach to software updates is really useful for remotely updating Macs with ssh, setting up automated updates via a bash script, or if you just want to geek out.
This tool is available in all versions of Mac OS X and macOS and therefore it can be used to update just about any Mac with necessary software updates.
This is one way to avoid using the Mac App Store to update a Mac if that is necessary for whatever reason. Another would be to use Combo Updates for updating Mac system software, or getting other packages from Apple via the Support Downloads page.
If you have any other tips or tricks for command line softwareupdate in Mac OS, share them in the comments below!