jamf binary equivalent to "pkgutil --forget <receipt>"?

donmontalvo
Esteemed Contributor III

Is there a jamf binary command to forget Casper receipts residing in /Library/Application Support/JAMF/Receipts/, in the same way that Apple's pkgutil --forget <receipt> command removes receipts residing in /private/var/db/receipts/?

--
https://donmontalvo.com
3 ACCEPTED SOLUTIONS

mm2270
Legendary Contributor III

Don't think so. But... sudo rm -Rfd /Library/Application Support/JAMF/Receipts/package_receipt.pkg; sudo jamf recon works. :)

View solution in original post

stevewood
Honored Contributor II
Honored Contributor II

Okay, then how about:

ls -la /Library/Application Support/JAMF/Receipts/

sudo rm -Rfd /Library/Application Support/JAMF/Receipts/yadayada.pkg; sudo jamf recon

:-)

View solution in original post

mm2270
Legendary Contributor III

Don, as far as I can see, doing pkgutil --packages / lists all the stuff that resides in the /Library/Application Support/JAMF/Receipts/ folder as well as items installed via the regular OS installer. That command finds all package receipts on the drive, regardless of where they live. Only issue is, it doesn't show a distinction between the ones in the JAMF folder as opposed to other location. If it showed the path to the receipt it would be easy to parse out but from what I can see there is no way to get it to do that. Adding --verbose doesn't help :/

That said, really a simple ls -l /Library/Application Support/JAMF/Receipts/ should work on listing out what's there. From there you can just target the package you want to remove, no?

If the ls command doesn't thrill you, try using Spotlight's API. I just recently began playing around with that stuff and am finding it to be pretty powerful.

mdfind -onlyin /Library/Application Support/JAMF/Receipts/ "kMDItemContentType == 'com.apple.installer-package-archive'"

That will give you a nice neat list of all the actual receipts in the /Library/Application Support/JAMF/Receipts/ folder, including the full path. It would be easy to pull one of those and use it with a remove command after. The nice thing about using Spotlight to list specific file or content types is it will not include anything that happens to be in that folder that isn't a true package receipt.

Edit: updated command

View solution in original post

6 REPLIES 6

mm2270
Legendary Contributor III

Don't think so. But... sudo rm -Rfd /Library/Application Support/JAMF/Receipts/package_receipt.pkg; sudo jamf recon works. :)

donmontalvo
Esteemed Contributor III

Yep, BFH can work, but I was hoping to be able to selectively delete (pkgutil --pacakges to list, pkgutil --forget <yadayada> to remove). :)

--
https://donmontalvo.com

stevewood
Honored Contributor II
Honored Contributor II

Okay, then how about:

ls -la /Library/Application Support/JAMF/Receipts/

sudo rm -Rfd /Library/Application Support/JAMF/Receipts/yadayada.pkg; sudo jamf recon

:-)

donmontalvo
Esteemed Contributor III

OK, if JSS only cares about the receipts that are present, IOW, no database history of what was installed, I guess a BFH will work. :)

--
https://donmontalvo.com

mm2270
Legendary Contributor III

Don, as far as I can see, doing pkgutil --packages / lists all the stuff that resides in the /Library/Application Support/JAMF/Receipts/ folder as well as items installed via the regular OS installer. That command finds all package receipts on the drive, regardless of where they live. Only issue is, it doesn't show a distinction between the ones in the JAMF folder as opposed to other location. If it showed the path to the receipt it would be easy to parse out but from what I can see there is no way to get it to do that. Adding --verbose doesn't help :/

That said, really a simple ls -l /Library/Application Support/JAMF/Receipts/ should work on listing out what's there. From there you can just target the package you want to remove, no?

If the ls command doesn't thrill you, try using Spotlight's API. I just recently began playing around with that stuff and am finding it to be pretty powerful.

mdfind -onlyin /Library/Application Support/JAMF/Receipts/ "kMDItemContentType == 'com.apple.installer-package-archive'"

That will give you a nice neat list of all the actual receipts in the /Library/Application Support/JAMF/Receipts/ folder, including the full path. It would be easy to pull one of those and use it with a remove command after. The nice thing about using Spotlight to list specific file or content types is it will not include anything that happens to be in that folder that isn't a true package receipt.

Edit: updated command

donmontalvo
Esteemed Contributor III

Steve, Mike, both of your suggestions work. Thanks!

--
https://donmontalvo.com