Terminal Install – Guide to Installing .pkg with Terminal

installpkgterminal

Is it possible to install a .pkg using a terminal ? (I wanted to install an app through ssh).

Best Answer

/usr/sbin/installer

The installer command is used to install Mac OS X installer packages to a specified domain or volume. The installer command installs a single package per invocation, which is specified with the -package parameter ( -pkg is accepted as a synonym). It may be either a single package or a metapackage. In the case of the metapackage, the packages which are part of the default install will be installed unless disqualified by a package's check tool(s).

See man installer for the full functionality. Often

sudo installer -pkg /path/to/package.pkg -target /

is all that's needed. Here / is the mount point of Macintosh HD volume. -target accepts path like "/Volumes/Macintosh HD", or /dev/disk0 also.