Shutdown and apply updates with OS X

Is it possible to shutdown + update the Mac ? It's annoying to wait for it to restart when I just want to click update and go home.

I've seen this once on a MacBook and I can't find how to do it.


Solution 1:

I think that if you download all updates and then shutdown your mac instead of restarting (ignoring popup), it will install updates and shutdown.

Solution 2:

This method seems to be more successful for me:

$ sudo sh -c "softwareupdate -i -a; shutdown -h now"

The above sudo -s technique simply opened a new root shell for me (OS X Lion) which, upon exiting, ran the following two commands as a non-root user.

I guess an alternative would be to switch to root first, then run the two commands (separated by semi colon)

$ sudo su -
$ softwareupdate -i -a; shutdown -h now

Solution 3:

If you use the GUI software update, you may need to stick around and select "Yes" for certain dialog boxes. If you really want to minimize your time and effort involved in applying updates and then shutting down the computer, try this:

sudo -s; softwareupdate -i -a; shutdown -h now