Basics of Mac OS X Package management

The package management in Mac is quite non-existent compared to what Linux has to offer, e.g. Debian packaging which has full dependency resolving capabilities and ability to install package along with dependencies and uninstall along with dependencies.

Mac has a pkgutil command that knows something about installed packages on the operating system. It is also possible to dig information on what applications are installed on the OSX by using the System Profiler. In the System Profiler full report, all installed software is counted.

Here is man page for pkgutil:

How to determine what each package contains:

pkgutil –packages list installed packages.

then loop through all the packages and run

pkgutil –pkg-info packageid

for example:
pkgutil –pkg-info com.blackmagic-design.DaVinciResolveApplications

command prints out: “

package-id: com.blackmagic-design.DaVinciResolveApplications
version: 1
volume: /
location: Applications
install-time: 1328796965″

From this we know that the base directory for this package is Applications folder on system root volume /.

Then we can find out what files this package has installed under the base folder.

pkgutil –files packageid

“pkgutil –files com.blackmagic-design.DaVinciResolveApplications
DaVinci ….
– rest of the printout is clipped because it is large -….”

This information is actually found from a folder, pkgutil just finds the same information that is stored in bom and plist files under:

The bom-files can be inspected with command lsbom.

The plist files are typically binary format, but they can be converted to readable xml format using plutil:
plutil -convert xml1 -o –
This is hardly needed because the plist files can be also read with defaults read -command as follows:
defaults read /private/var/db/receipts/
Please note that you must specify full url to defaults read, if you are in directory /private/var/db/receipts and try to execute defaults read ./ – it will not work.

Useful parameters for lsbom:
-s list only files (the numeric information disappears with this):
cd /private/var/db/receipts
lsbom -dfls

Someone has made a simple script to uninstall bom:
And here are instructions how to use that script:
How to use uninstall_bom

  1. No trackbacks yet.

You must be logged in to post a comment.
%d bloggers like this: