Friday, April 19, 2013

Run Software Update via command line

Apple allows Software Update to be called via the command line program softwareupdate. In many cases, this method of running the program is preferred as you can call it via SSH sessions on remote computers. You can also use it locally if you are in a Terminal window already (or you just find it odd to fire up the App Store to update your system software in OS X 10.8).

Here is the rundown for running softwareupdate via an SSH session on a remote computer:
  1. Via Terminal or SSH session, invoke the Software Update program via the command sudo softwareupdate -i -a -v
    1. Per Apple, the command requires sudo in the beginning.
    2. Basically, the -i flag tells the program to install updates, the -a flag tells the program to install all updates, and the -v provides verbose output with a little more information output to the Terminal
    3. To learn more about the different options, you can run sudo man softwareupdate
  2. That should be it - if any of the updates need a reboot the user will be prompted to Save documents and reboot at the earliest possible time. Type exit once the updates run to end the SSH connection.
Note: This only installs the Software Updates provided by Apple and not Flash, Java 7 from Oracle, or any software not installed via the App Store.

No comments:

Post a Comment