|
mac geekeryGet your geek on. |
Software Update and Package Installation From the CLIMarch 16, 2007 - 11:33pm
For those of you that didn’t know (and it’s an honest omission of knowledge) Apple’s Installer and Software Update tools have CLI tools that do their dirty work for them, and you can use them to remotely administer your machine (or do so more directly than the GUI lets you). The Installer’s CLI command is, shockingly, $ installer -pkg GoshIHopeItsNotATrojan.pkg -target / You can also have a little fun with it with its myriad options. Software Update is similarly called $ softwareupdate -l Or install all pending updates with: $ sudo softwareupdate -i -a It, too, has a manual page that talks about its options. Be aware that for any install for which the GUI would request authorization (pretty much any update), you’ll need to run this as root during the install. You can, however, list and download updates as any user. Note that, unlike the GUI, this tool does not check for already-downloaded updates when installing. Thus, if you told it softwareupdate -d -a to download all updates and then softwareupdate -i -a it would not use the package cache at /Library/Packages but would download them instead. To use the package cache, issue the command to have $ for FILE in /Library/Packages/*pkg; do sudo installer -pkg $FILE -target /; done About Adam Knight |
|
||||