Search

Top Posts

Comments

  • James: Well, it hasn’t crashed on me yet, and I’ve been using it for at least 2 months now…
  • Dasher: Any experience creating a RAM disk, specifically for helping iTunes run faster? I am on a 2006 Imac 21″...
  • sam: I have os 10.5.8 but i dont have this. Wtf?
  • MMES: If you customize the equalizer setting in iTunes, those settings will carryover to the iPhone and you can enjoy...
  • hadjime: Doesn’t work on me… i remove the file and then i open photo booth and it’s still wotking

Categories

Recent Posts


Install software updates from the command line

We all know the familiar Mac OS X Software Update panel, it pops up weekly to give us a nice GUI interface to install all the latest updates to our Apple software. But did you know that you can get the same list, and even install updates from the command line? Installing software updates from the command line is incredibly useful for remote management of machines, just SSH into a Mac and run the appropriate commands. Read on for more…


To install software updates from the command line, you’ll use the aptly named ’softwareupdate’ command. Here are the most relevant usages of the command for most users:

softwareupdate -l will give you a list of all updates available
softwareupdate -i [package name] will install the specified package
softwareupdate -i -a will install all updates available
softwareupdate -i -r will install only the recommended updates
softwareupdate --ignore [package name] will ignore specified update
softwareupdate --help for more info on the softwareupdate command

You’ll likely need to use the sudo command to actually install the updates on a Mac, simply place sudo in front of one of the above commands to run it with full permissions as root.
For example: sudo softwareupdate -i -r

Posted by: Editor

Share

Save big on Mac Deals from Amazon.com

Comments:

Comments: 5

Comment from Peter Rose
Time: April 19, 2007, 12:35 am

Somehow I have never known about this, you just made my job a whole lot easier though, thanks a bunch

Comment from anon
Time: October 8, 2007, 1:53 pm

For the record, I would recommend against doing this for the time being — it seems to have hosed my machines recently, hard to say if it’s from the updates or from using this command. I think it’s buggy.

Pingback from Mac Info » Blog Archive » Software Update z příkazové řádky
Time: April 14, 2008, 6:38 am

[...] Zdroj: OSXDaily [...]

Comment from lakorai
Time: March 12, 2009, 1:16 pm

For users trying to do this over Apple Remote Desktop and you would like to pull the updates from a local OSX Server you do this:

Open up Apple Remote Desktop
Choose the computers you wish to update from the computer list that you have created. Click the UNIX button at the top of the window.

IMPORTANT: On the ratio button click the “user” button. Now type in the username that you use in ARD to control the machines. In my case I use “arduser”. If you don’t do this ARD will complain that a correct console user is not available.

Next type in the command

softwareupdate (switches as described above) (ip address or domain name of local OSX Update server)

where the switches are the type of command you want (-l, -a etc)

and the IP address of the server you want to pull from.

in my example it would be

softwareupdate -i 192.168.1.240

This will tell Software Update to list all available updates AND to poll those updates from 192.168.1.240 NOT from Apple’s SU servers. If you WANT ard to pull from the Internet then just don’t place an ip address or domain after the command (this is what you want if you aren’t running a OSX Server on your network)

You can use a domain name instead if your DNS settings are set in the Network control panel and your DNS server(s) are setup correctly.

Comment from klaus
Time: February 25, 2010, 4:21 pm

great, I have broken my logon. windowserver crashed.

maybe this is my hope :(

Write a comment






April 18th, 2007