Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Prior to Mountain Lion, I was able to install packages with /usr/sbin/installer as an Admin user. However, with Mountain Lion, when I try running

installer -pkg blah.pkg -target /

I get the error

installer: Must be run as root to install this package.

I've monkeyed with the IFPkgFlagAuthorizationAction variable in the package's info.plist, setting it to AdminAuthorization and even UserAuthorization, but that doesn't seem to have any effect.

I can install with sudo to actually run as root, but the software (correctly) expects me to install as a non-root users and thus doesn't work.

If I use the GUI on the same package (even without modification to IFPkgFlagAuthorizationAction), I am prompted for an Admin—not root—password and everything works as expected.

How do I get the behavior of the GUI tool from the command line?

share|improve this question

I ran into the same issue today. ;)

I can't help you run the installer as root while giving the installed files the ownership of a regular user, but you should be able to change the ownership after the install to get the same effect and ultimately get around this restriction.

If, for example, your user account is "myusername" and you have a group such as "_developer" that is a better owners group for the application you are installing, you could reset the ownership after install via something like:

sudo chown -R myusername:_developer ~/Library/[MYAPPNAME]
sudo chown -R myusername:_developer ~/Library/Application\ Support/[MYAPPNAME]

It seemed to work in my situation. Might help you, too. Of course, paths and user/group names would be particular to your situation. :)

share|improve this answer

You must log in to answer this question.

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