Listing contents of installed packages in Mac OS X

While bundles are easy to uninstall (by dragging them to the Thrash), packages are difficult to uninstall since Mac OS X doesn’t have a native uninstall facility (like in GNU/Linux).

In Mac OS X applications can be packaged as bundles (a directory tree, like Mail.app/) or as packages using “Installer” or the command line “installer” tool.

While bundles are easy to uninstall (by dragging them to the Thrash), packages are difficult to uninstall since Mac OS X doesn’t have a native uninstall facility (like in GNU/Linux). Instead, the application package must supply an uninstaller. Some packages don’t provide an uninstaller, so how do we can uninstall them?

The answer lies in the “/Library/Receipts”, where every installed package creates a subdirectory with the same name as the package. For example, Fondu creates a receipt named “/Library/Receipts/Fondu-021223.pkg/”. Inside this receipt directory, we should be able to find a file with a “.bom” extension, which holds the list of files installed by the package. We can use the “lsbom” command-line tool to reveal what the contents of an installed package are. For example, to list the contents of the Fondu package:

# lsbom //Library/Receipts/Fondu-021223.pkg/Contents/Archive.bom
. 40755 501/20
./usr 40755 501/20
./usr/local 40755 501/20
./usr/local/bin 40755 501/20
./usr/local/bin/dfont2res 100755 501/20 22692 1924128762
./usr/local/bin/fondu 100755 501/20 80828 3987236398
./usr/local/bin/frombin 100755 501/20 26612 1252278923
./usr/local/bin/showfond 100755 501/20 48732 2572856512
./usr/local/bin/tobin 100755 501/20 34892 1234820618
./usr/local/bin/ufond 100755 501/20 96660 523810372
./usr/local/man 40755 501/20
./usr/local/man/man1 40755 501/20
./usr/local/man/man1/dfont2res.1 100644 501/20 599 1712045017
./usr/local/man/man1/fondu.1 100644 501/20 1677 2399414942
./usr/local/man/man1/frombin.1 100644 501/20 602 3676561646
./usr/local/man/man1/showfond.1 100644 501/20 568 2643007451
./usr/local/man/man1/tobin.1 100644 501/20 1315 3726043
./usr/local/man/man1/ufond.1 100644 501/20 1988 585312571

Using this list, we can manually remove the Fondu package by removing every listed entry. If it’s a file, it can be deleted, but if it’s a directory, we must be sure it’s empty and not being used by any other package.

Advertisements

One thought on “Listing contents of installed packages in Mac OS X

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s