How do I forget an unforgettable OSX package?

Some time ago I must have installed Tor and some other tools that came along with it. Later I must have uninstalled it but I don't remember how. Now I find these packages in my package database but I cannot remove them with --forget. The files from the package don't exist anymore.

The /var/db/receipts/Tor 0.2.0.35.bom and /var/db/receipts/Tor 0.2.0.35.plist files don't exist anymore. I've tried adding some empty files and then the error disappears but the package stays in the database. I've also tried creating a package with the same pkgid but that didn't work either.

Or is this a problem with the space in the package id?

I'm trying this on 10.7.3.

# pkglist | grep -i 'Tor 0.2.0.35'
Tor 0.2.0.35

# pkgutil --forget 'Tor 0.2.0.35'
Unknown error Error Domain=NSCocoaErrorDomain Code=4 "“Tor 0.2.0.35.bom” couldn’t be removed." UserInfo=0x7f9b4d071dd0 {NSFilePath=/var/db/receipts/Tor 0.2.0.35.bom, NSUserStringVariant=(
    Remove
), NSUnderlyingError=0x103b15c10 "The operation couldn’t be completed. No such file or directory"}.
Forgot package 'Tor 0.2.0.35' on '/'.

# pkglist | grep -i 'Tor 0.2.0.35'
Tor 0.2.0.35

Solution 1:

If you don't have this file in /var/db/receipts, check /Library/Receipts and there it should be. If you remove this manually then it will disappear from 'pkgutil --pkgs'.