Running Mac’s Software Update From The Command-Line

November 17, 2008 – 3:00 pm

OS X comes with a command-line tool called ’softwareupdate’ that installs recommended and optional Software Updates available from Apple. The tool can be used to install the updates to a local computer or a remote one.

softwareupdate requires root access, the fastest way to do so is to execute softwareupdate with sudo prefixed to it, and you will be asked for the admin’s password. So to install all the available updates use the -i option for install and the -a option for all:

sudo softwareupdate -i -a

And to install the recommended updates only, use the -i option with -r:

sudo softwareupdate -i -r

Another command-line option available is -l, which lists all the available updates. This option also shows next to each update available if it is recommended or it needs a restart.

To use softwareupdate in a remote Mac, connect to it with SSH first using the following command:

ssh <admin_name>@<computer_name>

Replacing admin_name> with the short name of the remote Mac’s local administrator, and <computer_name> with the computer’s DNS name or IP address. After the connection is established, softwareupdate can be used as shown above with out any change.

  • Share/Bookmark

Post a Comment