Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 24 down vote accepted


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.

share|improve this answer
I usually type "sudo installer -pkg /path/to/package.pkg -target /" and it works fine. – PEM8000 Nov 21 '12 at 14:22
Perfect, thanks to you both. – Matthieu Riegler Nov 21 '12 at 23:17
This comment should be included in the answer. Mere copy and pasting of this command is sufficient in many cases. – Dilawar Oct 26 at 4:54
@Dilawar anybody can edit existing questions/answers on AD :-) – patrix Oct 26 at 8:24

If you are looking for a way to install multiple .pkg files via the command line then take a look at installpkg :

share|improve this answer
Welcome to Ask Different. - Be sure to fill out your profile and self-disclose if you are promoting a product you created or are paid to work for/on. – bmike Dec 6 '14 at 21:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.