View program installation details

Ever wonder exactly what gets installed when you run one of Apple’s Software Updates? Wonder what some application installed as it ran through it’s installer? If you’re lucky, there’s a nice set of release notes avaialble, explaining exactly what was installed and/or updated. But more often than not, you’ll just get a brief synposis of what was installed and/or updated. But using the Terminal, you can (usually) find out exactly what a given installer did when it ran.

OS X keeps track of things that were installed using its installers in the /Library/Receipts folder. If you open Terminal and type ls -al /Library/Recipts, you’ll most likely be greeted by a long list of things—there are 150 items in that folder in my machine. Each of these represents the receipt from something you installed—a new application, a system update, etc. Each of these receipts is actually a package, as denoted by the .pkg extension. So each of these files are actually directories, containing many more files. Within the bundle of files is one that contains the information we want—what was installed by this package?

As an example, everyone should see a Safari.pkg in the output of the above ls command. (If by some chance, you don’t, you can still follow the below example, but just choose a package that exists on your system.) Type these commands into the Terminal (ignore the $, that’s just the prompt):

	$ cd /Library/Receipts
	$ cd Safari.pkg/Contents
	$ ls -al
	

These three commands do the following: (1) switch us into the Receipts directory, (2) navigate into the Contents folder within the Safari package, and (3) list the files within that folder. The output should be something like this:

	total 920
	drwxrwxr-x    6 root  admin     204 May 17 20:22 .
	drwxrwxr-x    3 root  admin     102 May 17 20:22 ..
	-rw-rw-r--    1 root  admin  461735 Mar 25  2005 Archive.bom
	-rw-rw-r--    1 root  admin    1067 May 17 20:22 Info.plist
	drwxrwxr-x   21 root  admin     714 May 17 20:22 Resources
	-rw-rw-r--    1 root  admin     415 Mar 25  2005 version.plist
	

The file we’re interested in is Archive.bom. This file contains a list of every file that the Safari installer “touched” when it ran. Using a built-in Unix command, lsbom, we can read this list of files:

lsbom Archive.bom -pf | more

Now, that may look complex, but it’s really pretty simple. First is the command itself, then the file we wish to use to read it. Next, the -pf option tells lsbom that we only want to see the filename portion of its output—otherwise, you get all sorts of extraneous information that you really don’t need to see. Finally, the | more bit just tells the Terminal to pause after each screenful of output. As soon as you press Return, output will start filling your Terminal window. As you’ll see, the list of files is huge—2,900+ files, in fact.

So why might you want to look at this huge list of files? In reality, you probably wouldn’t want to do so for something like Safari—I just chose it as an example, hoping everyone might have it available. lsbom is much more useful for small apps and utilities that use Apple’s installer, but then don’t tell you anything about what they did. If that’s the case, head into your Receipts folder, navigate into the program’s package, and then use lsbom to see exactly what went on.

Finding .bom Files

In the above example, Safari’s Archive.bom was located in the Contents folder within the Safari package. This is generally where you’ll find most .bom files, and most will be named Archive.bom. As with all good rules, however, there are exceptions. The DVD Player Update, for instance, named its .bom file DVDPlayerUpdate.bom, and it’s located in the update’s Contents/Resources folder. One easy way to do so is to use find to search in all packages, or just the one you’re interested in. If you just want to search one package, first cd into that package; if you want to search all packages, make sure you’re in the /Library/Receips folder. In either case, then run this command:

find . -name "*.bom" | more

This will locate any .bom files at or below the currently active directory, and display their names and full path on your screen.

Conclusion

You may not need to use the Receipts folder every time you install something. But if you’re ever a little bit curious about what might have been installed, you’ll be glad it’s there. As a gentle reminder, do not remove things from the /Library/Receipts directory—it’s one of the ways that OS X knows about the stuff that’s been installed and/or upgraded on your system.

To comment on this article and other Macworld content, visit our Facebook page or our Twitter feed.
Shop Tech Products at Amazon