Nick Shubin
 Home  Articles  Photos  Publications  Site Map

 

Nick Shubin

How to Clear the History of the Installed Software

on Mac OS X 10.6 Snow Leopard

September 09, 2009

 

Preface

When you update or re-install a program, the standard Mac OS installer compares the version of the already installed application with the version indicated in the installation package. This version verification prevents the user from installation of the older version of a program. This causes a problem when you need to return to the previous version.

In Mac OS X, including version 10.5, the installer places a *.pkg file into the "/Library/Receipts/" folder. This file is usually named like the installer package. For example, "Disc Cover 2.pkg". Removing this file, you make it impossible to compare the version numbers. The installer passes the verification swimmingly.

On Mac OS 10.6 Snow Leopard, the "/Library/Receipts/" folder contains:

"InstallHistory.plist" seems to contain the information we need. Every time you run installation, a new item is added. If you install a newer version of the program, the information about the previous version will remain in the installation history. Try to delete such a record and you'll see that it doesn't help to clear the history. Obviously, "InstallHistory.plist" is not the replacement for *.pkg files used in the earlier versions of Mac OS.

install_history

 

The Actual Location of the Installer Package Receipt Database

What we are looking for is located in a hidden folder in the system volume:
/private/var/db/receipts/

To open the content of this folder in Finder:

  1. Copy the path above.
  2. Press Cmd-Shift-G in Finder.
  3. Paste the path and click Go.

 

The installer adds two types of files into this folder:

The file name structure is very similar to the preferences file. For the Disc Cover application, files are named as follows:
com.belightsoftware.DiscCover2.bom
and
com.belightsoftware.DiscCover2.plist

This is a sample content of *.plist

plist_dc

 

How to Preview, Modify and Remove the Installer Information

To cheat the installer, you can delete the corresponding *.plist file. Note that admin's permissions are required to modify or delete the *.bom and *.plist files.

The "right" way to delete the *.plist files is to use shell (Terminal) commands. To open the Terminal, run the Applications/Utilities/Terminal.app application. Also, you can delete *.plist in Finder. The author doesn't have any information if this can cause any problem in the future.

For an alternative, you can change the version number in *.plist. For example, you had version 1.2.3 of some application. In *.plist, the PackageVersion parameter will be equal to 1.2.3. To install version 1.2, set PackageVersion to 1.0.

The *.plist file is in the binary XML format. To edit it, use the Property List Editor application (it is not included in the default Mac OS installation).

 

To output the list of all installer package receipts, use this shell command:
pkgutil --pkgs-plist

The Terminal displays package id this way:
<string>com.apple.pkg.Rosetta</string>
<string>com.apple.pkg.Safari</string>
<string>com.apple.pkg.Samsung_Common</string>
<string>com.apple.pkg.VersionedDeveloperToolsSystemSupportLeo</string>
<string>com.apple.pkg.WebKitSDKLeo</string>
<string>com.belightsoftware.DiscCover2</string>

The package id "com.belightsoftware.DiscCover2" corresponds to the "com.belightsoftware.DiscCover2.plist" file.

 

To output information saved in an installer package receipt:
pkgutil --pkg-info package-id
here and below, "package-id" should be replaced with the actual package name.
Example:
pkgutil --pkg-info com.belightsoftware.DiscCover2

 

To save the content of a *.bom file to a text file "bom.txt", use the lsbom shell command indicating the full path to each file.
Example:
lsbom /private/var/db/receipts/com.belightsoftware.DiscCover2.bom > bom.txt

 

To delete an installer package receipt:
sudo pkgutil --forget package-id
Example:
sudo pkgutil --forget com.belightsoftware.DiscCover2
you will be asked for the admin's password.

 

To access the *.bom and *.plist files in Finder:

  1. Choose Go > Go To Folder (Cmd-Shift-G) in the menu.
  2. Paste this path into the "Go to the folder" edit box:
    /private/var/db/receipts/
  3. Click Go.

 

Editing and removing files from "/private/var/db/receipts/" is potentially unsafe for the operating system and installed software. The author doesn't take any responsibility for the damage you may cause.

Before editing or removing the *.bom and *.plist files in Finder, change the permissions to "Read and Write". To do this, right-click on a file in Finder. Then select "Get Info" in the pop-up menu. The permissions settings are at the bottom of the panel.

 

Related information:
Apple Mailing Lists: Query for package id


© 2016 Nick Shubin. All rights reserved.