How are *.dmg packages installed via the command line?
I noticed that they can be mounted with:

me@MacBook-Pro:~$ open /Users/me/Downloads/installer.dmg

What's next?

  • As long as you do not want to specify another destination and your software is in pkg format, you go: sudo installer -pkg /Volumes/DMGNAME/PKGNAME -target / Be careful: if your software requires a reboot afterwards, the installer will not automatically do this. You have to do it on your own. (Reference: hints.macworld.com/article.php?story=20030614230204397) Sep 14 '15 at 14:01

Assuming that the diskimage contains a package or packages, you would list the packages on the mounted filesystem and then use /usr/sbin/installer


After mounting, you need to cd /Volumes/xyz (where xyz is the mounted volume)

  • And then do what to install the software?
    – nohillside
    Sep 14 '15 at 14:53
  • @patrix yep. You should use "hdiutil mount diskimage.dmg" instead of the open command
    – At0mic
    Sep 14 '15 at 22:13

Not the answer you're looking for? Browse other questions tagged .