Unable to uninstall: Receipt not found in database

98 views
Skip to first unread message

Chris Freitag

unread,
Mar 23, 2022, 4:43:02 PM3/23/22
to munki-discuss
In testing a printer driver on a Monterey client, I am unable to uninstall the item due to an error:

ERROR: com.apple.pkg.HewlettPackardPrinterDrivers not found in database

However, when I check the receipt database by running pkgutil --pkgs, the receipt is listed in the output.

Is Munki looking elsewhere for this receipt?





Gregory Neagle

unread,
Mar 23, 2022, 4:47:11 PM3/23/22
to 'Gregory Neagle' via munki-discuss

Chris Freitag

unread,
Mar 23, 2022, 4:54:26 PM3/23/22
to munki-discuss
How do I resolve this?

Gregory Neagle

unread,
Mar 23, 2022, 6:55:18 PM3/23/22
to 'Gregory Neagle' via munki-discuss
I don’t have an answer for you, but I can (kind of) reproduce the issue under macOS 12.3 on Apple silicon:

$ sudo removepackages -l com.apple.pkg.HewlettPackardPrinterDrivers
    Gathering information on installed packages...
0..20..40..60..80..100
0..20..40..60..80..100
ERROR: com.apple.pkg.HewlettPackardPrinterDrivers not found in database.

Gregory Neagle

unread,
Mar 23, 2022, 6:56:40 PM3/23/22
to 'Gregory Neagle' via munki-discuss
Of course that’s useless, because:

$ pkgutil --info com.apple.pkg.HewlettPackardPrinterDrivers
No receipt for 'com.apple.pkg.HewlettPackardPrinterDrivers' found at '/'.

-- 
You received this message because you are subscribed to the Google Groups "munki-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/munki-discuss/448582AA-38D4-4C8B-8FEC-A0AE95D6FD57%40mac.com.

Gregory Neagle

unread,
Mar 23, 2022, 7:08:03 PM3/23/22
to 'Gregory Neagle' via munki-discuss
On a machine where that receipt is present:

# sudo removepackages com.apple.pkg.HewlettPackardPrinterDrivers
    Determining which filesystem items to remove...
    Removing 4765 filesystem items...
0..20..40..60..80..100
    Removing receipt info...
0..20..40..60..80..100
    Package removal complete.

Gregory Neagle

unread,
Mar 23, 2022, 7:18:05 PM3/23/22
to 'Gregory Neagle' via munki-discuss
Note that once you remove this, it might be difficult to get Munki to reinstall it, because the pkg receipt is still present:

# pkgutil --forget com.apple.pkg.HewlettPackardPrinterDrivers
Unknown error Error Domain=NSCocoaErrorDomain Code=4 "“com.apple.pkg.HewlettPackardPrinterDrivers.bom” couldn’t be removed." UserInfo={NSUserStringVariant=(
    Remove
), NSFilePath=/var/db/receipts/com.apple.pkg.HewlettPackardPrinterDrivers.bom, NSUnderlyingError=0x7fdd00c537b0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}.
Forgot package 'com.apple.pkg.HewlettPackardPrinterDrivers' on '/'.

pkgutil lies and tells you it removed it (and even returns 0) but the “Unknown error” clues us into the fact that it actually did not remove it:

# pkgutil --info com.apple.pkg.HewlettPackardPrinterDrivers
package-id: com.apple.pkg.HewlettPackardPrinterDrivers
version: 10.6.0.1.1.1602826228
volume: /
location: /
install-time: 1644444699
groups: com.apple.SnowLeopardPrinters.pkg-group com.apple.snowleopard-repair-permissions.pkg-group com.apple.FindSystemFiles.pkg-group 

Reply all
Reply to author
Forward
0 new messages