Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I am trying to install the osx-gcc-installer for 10.7.

I want to install it with the installer command.

The installer command requires a -target parameter and it is the part I am not sure about.

  1. Is there any convention for target location for this kind of pkg file ('developer tools')? /opt or /etc/ or /var?

  2. Is there an uninstall counterpart to installer?

share|improve this question
up vote 1 down vote accepted

Read the manpage of installer. The -target option does not specify a directory, but an actual volume (emphasis mine):

The target volume is specified with the -target parameter ( -tgt is accepted as a synonym). It must already be mounted when the installer command is invoked.

So, just run it, specifying your boot volume:

installer -pkg GCC-10.7.pkg -target /

I guess that should be enough. A package installer knows where to put its files.

Is there an uninstall counterpart to installer?

Not really. Every package installer also creates a so-called "receipt" which contains a list of those files that were installed. This receipt is mostly used for repairing permissions, but can also (theoretically) be used to "undo" package installations.

These receipt files are located in:

  • /var/db/receipts starting with OS X 10.6.
  • /Library/Receipts/db or ~/Library/Receipts/db/ in OS X 10.5 (but here, it's an Sqlite database)
  • /Library/Receipts in OS X 10.4

Using the lsbom command, you can list the contents of such a receipt file.

lsbom -fls /var/db/receipts/

This gives you a list of files. If you need to, you can try to remove all of these files. But I have never seen somebody really encourage that. Your mileage may vary.

share|improve this answer
The target can also be specified as just -target / (instead of "/Volumes/Macintosh HD"). Some people have renamed the boot volume. – user495470 Apr 26 '12 at 10:12
True that. It was even mentioned in the manpage. – slhck Apr 26 '12 at 10:17

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.