Never been to TextSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Mount and install OS X packages from the command line
If you need to install a .pkg application wrapped in a .dmg file from the command line (say, if you only have SSH access to the machine) there are a few command line utilities that will let you do this. For instance, let's say you're trying to install DarwinPorts on a remote OS X box.
curl -O http://darwinports.opendarwin.org/downloads/DarwinPorts-1.2-10.4.dmg
hdiutil attach DarwinPorts-1.2-10.4.dmg
sudo installer -pkg DarwinPorts-1.2.pkg -target "/"
hditutil detach /Volumes/DarwinPorts-1.2/
In a nutshell, this 1) goes to your Desktop folder 2) grabs DarwinPorts from the opendarwin site 3) mounts the dmg 4) goes to the newly mounted DarwinPorts volume 5) installs the package, targeted to the root, as the root user 6) ejects the mounted disc image.
Comments on this post
You need to create an account or log in to post comments to this site.