Installing packages from the command line

Jun 17, '03 10:00:00AM

Contributed by: Anonymous

I sometimes need to install updates remotely on a server I maintain. I already knew about the command line version of softwareupdate, but I was looking for a way to install packages (.pkg) that were already located on the remote box. I finally found the installer command. To install a package, type:

 sudo installer -pkg Desktop/Java1.4.1.pkg -target /
In most cases, -target will be the root of your boot volume (/), but you may also specify /Volumes/OtherDrive. Also note that the installer will not prompt you if the update requires a restart. If you know that it requires a restart, type sudo reboot after confirmation of successful install.

For more info see man installer.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030614230204397