How do I remove MacOSX packages?

While you can easily install MacOSX packages, there doesn't seem to be a way to quickly remove them??!?! I'm looking for a command-line or other tool that maybe can read the package info from /Library/Receipts to fully remove a package.

PowerBook G4, Mac OS X (10.4.3)

Posted on Dec 17, 2005 6:05 AM

Reply
8 replies

Dec 17, 2005 10:53 PM in response to MegaFlop

I understand that if you remove the pkgs in receipts, you can no longer repair permissions. Not a good move. Permssions should be repaired before and after every software installation, and weekly. Will be done automatically weekly if you leave your computer on 24/7 and don't let the CPU sleep. I use Macaroni; it's more reliable than the system schedule.

G5 dual 2 GHz; iBook dual USB Mac OS X (10.4.3)

Dec 18, 2005 5:36 PM in response to MegaFlop

For future reference, the command line version version of what you did is as follows:

WARNING: This only works if the installer package was properly made and the default install destination was the root of the boot drive. It is advisable to run the "lsbom -fls" command separately to check for files and file path listings.

lsbom -fls
/Library/Receipts/<packagename>/Contents/Archive.bom
| (cd /; sudo xargs rm)

Watch out for line breaks. I have purposely added a line break after -fls and a line break after Archive.bom. The entire command should be on one line.

A package installer and its receipt contain a file "Archive.bom" that lists all the files it installs and where they are to be installed. This command will list the files and paths to the files and any symbolic links installed. See "man lsbom". This bill of materials is then piped to a command to change directory to the root of the boot drive and remove the "xargs" as the super user.

You can then remove the package receipt manually.

Dec 18, 2005 4:42 AM in response to MGW

Here's what I'm trying to do. A while ago, I downloaded an nmap3.50 .dmg and ran the installer which installed one or more files somewhere. I know the binary was installed in /usr/local/bin but were there other files also installed somewhere else? A package management system is supposed to keep track of all that and will allow you to remove all installed files easily. For example, in Solaris, you use "pkgadd" to install a package. When you want to get rid of it, you run "pkgrm" and it deletes every single installed file that the package originally installed plus it does other cool things like make sure there are no other packages that are dependant on the one you're trying to delete.

Dec 18, 2005 5:09 AM in response to MegaFlop

Since I'm beginning to suspect the answer to my question is - "it can't be done on MacOSX/Darwin" - I'm going to reply to my own post.

This is what I did to remove the package:

1. double-clicked on the Nmap3.50 package in /Library/Receipts

2. in the installer documentation, I found - "all files will be installed in /usr/local"

3. logged in as root in a Terminal window

4. ran "find /usr/local -name ' nmap' -ls"

5. eyeballed the output from above command and manually "rm" nmap files and directories

6. dragged the .pkg file in /Library/Receipts to the trash

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I remove MacOSX packages?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.