How to apply OS X software updates from the command line

In addition to the Mac App Store, you can use the Terminal to access and install available software updates.

Apple's Software Update is a convenient and easy way to keep your Mac up-to-date with the latest security fixes and feature enhancements. To make the service user-friendly, it's been available as a simple graphic-based tool in the Apple menu, but in recent versions of OS X Apple has integrated this service with its Mac App Store. Though it's convenient for most people, if you do not wish to open the Mac App Store for managing updates, there's a way you can avoid it.

Unfortunately there is no known way to revert the Software Update service from the Mac App Store to the old Software Update utility. Even though the old Software Update exists in Mountain Lion's /System/Library/CoreServices/ directory, when launched the system will instead defer to the Mac App Store. Apple also prevents you from removing or modifying the App Store application, but if you do manage to do so, then unlike older versions of OS X such as Snow Leopard, in which system services would revert to their older implementations without the presence of the store, in Mountain Lion the services simply become unavailable. As a result, if you delete the store, the system will not provide a means to apply system updates.

If you don't want to use the App Store for applying updates to your system or if the store is giving you errors, there is another approach: use the softwareupdate command in the Terminal. In most versions of OS X, Apple included this command to help manage systems remotely without having to use screen-sharing services. By logging into a system using the command line, you could keep it up-to-date by running the softwareupdate command.

To get a full synopsis of the command and its uses, you can run "man softwareupdate" in the Terminal to see the Unix manual page for the command, or you can run the command itself to get a brief usage output summary:

Software Update running in the Terminal
When you run the softwareupdate command, the system will download the specified packages, check them, and install them just like the Mac App Store and Apple's now-retired Software Update utility. Screenshot by Topher Kessler/CNET

In basic usage, you need to be logged in as an administrator, after which you can open the Terminal and run the following options to perform basic updating tasks:

  1. List the updates, which will be listed as a name followed by a small information string that includes the version, size, and whether it is a recommended update and if it requires a restart:

    sudo softwareupdate --list

  2. Specify an update to install. In this case, change the word NAME to be that of one of the packages in the list, or you can use "--all" to install every available update, or "--req" to install only important system updates.

    sudo softwareupdate --install NAME

In addition to these steps to check for and apply updates, you can run the following options to perform other Software Update-related tasks such as ignoring updates or turning on automatic checking for new updates. In these uses of the command, replace NAME with the name of the update being targeted, as was outlined in step 2 above. For the scheduling option, you can replace "on" with "off" to turn off scheduled update checks.

sudo softwareupdate --ignore NAME

sudo softwareupdate --reset-ignored

sudo softwareupdate --schedule on

sudo softwareupdate --download NAME

These command-line based options mimic those in Apple's App Store, with the exception that so far there is no way to ignore an available update in the store. As a result, even though they are redundant with the more user-friendly options, if you have some Terminal familiarity, then you can use them to set the system to ignore certain updates or avoid using the App Store altogether, at least for system-related updates.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    ARTICLE DISCUSSION

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    Hot on CNET

    CNET's giving away a 3D printer

    Enter for a chance to win* the MakerBot Replicator 3D Printer and all the supplies you need to get started.