How to uninstall Mac OS X .pkg packages

13

pkg installerMost applications on OS X are distributed using either a .DMG disk image file or a .pkg installer. Installing using a DMG is the easiest. Just drag the application from the mounted image to the Applications folder and you’re done.

The .pkg installer, on the other hand, works like a traditional installer. Double click the program, go through a couple of steps using a Wizard and the application is installed. Unlike other operating systems, though, Apple doesn’t provide a simple method to uninstall applications.

In the case of a DMG based install, all you have to do is drag the application from the Applications folder into the Trash and it’s gone. A pkg based installer, on the other hand, doesn’t offer any such luxuries. The user depends on the developer to provide an uninstaller for their application, which is often not the case.

So, how do you uninstall applications installed using a .pkg installer ?

Well, the truth is other than using third party applications to handle uninstallation there really is no way … unless … you know which files are installed by the installer in the first place.

Since, there is no registry to take care of on Mac OS X, you only need to delete all files belonging to a particular application to remove all traces of the app.

OS X keeps track of all installed packages using receipts stored in the /Library/Receipts folder. Launch the Terminal application and list the contents of the Receipts folder using the ‘ls -al’ command.

pkg installer receipts

Suppose, I want to find out the list of files installed by the Mobile_Connect_Drv_App.pkg installer.

Use the cd command to browse into the above mentioned folder.

cd /Library/Receipts/Mobile_Connect_Drv_App.pkg/Contents

pkg bom file listing

The file that we’re interested in is Archive.bom. BOM stands for bill of materials and this is the file which contains the list of all the files installed by the pkg installer.

To read the Archive.bom file, we need to use the lsbom utility.

lsbom -pf Archive.bom | less

pkg BOM listing

The -pf options tells lsbom to only display the file names.

Now, you can just go ahead and delete all the files that lsbom lists. That should get rid of the package for good !

Sharninder:
Programmer, blogger and a geek making a living shifting bits around the Internet. Sharninder is the owner of Geeky Ninja

Most Popular Posts

13 Responses

  1. Scruffy Bob says:

    Hm, I went into /Library/Receipts and there was only an empty BSD.pkg file and a InstallHistory.plist file. I know I have installed several .pkg files recently, but there is no record of them there.

  2. Scruffy Bob says:

    I found the solution – in 10.6 (Snow Leopard), this directory is now /private/var/db/receipts.

  3. Scruffy Bob says:

    And I just found one more way to do this :)

    To get a list of installed packages:

    pkgutil --pkgs

    Then, you can get a list of files in the package with:

    pkgutil --files packagename

    • Sharninder says:

      That’s pretty cool Bob. I upgraded (from Tiger) last night and can see now that pkgutil is a much better way to view details about all the packages installed. I think the pkgutil –unlink command can also be used to perform an uninstall instead of manually deleting files.

  4. Cool.

    Now suppose a file, let’s say a library, is listed in a bom, but that file was already present in the system because some other app was installing the same library, following this method you will delete a shared library and you will break dependent programs relying on the file you have just deleted.

    My approach is now changed to: if a program is provided with .pkg format, don’t install it unless strictly necessary or it provides an uninstaller.

    Also read here: http://ildan.blogspot.com/2008/02/how-to-uninstall-mac-os-x-packages-pkg.html

    Notice that, in my case the files listed in the bom was with relative path:
    ./share/man/man3/gv.3ruby
    ./share/man/man3/gv.3tcl
    ./share/man/man3/gvc.3

    I found out that those files where where installed under /usrl/local
    At first I decided to go for removal, but after I tought that some shared libraries like
    ./lib/graphviz/libgvplugin_neato_layout.dylib
    could be used by other apps.
    So I reinstalled the application, and I am gonna keep it, just to prevent breaking other apps.

    Coming from Linux and apt packages, I’ll seriously think to punch in the face the next guy who tells me that OSX installs are cool.

    • Sharninder says:

      I agree Luigi. Apple should really come up with something like an apt installer. My post was only to make a point and teach the readers a little about how the .pkg files work.

  5. Chris says:

    Thanks for this! I wasn’t able to find the package receipt for the program I installed but, if you look in the .pkg file that installed the app, you will find all the necessary BOM files and, from there, the process is the same.

    Thanks a million!

  6. pepikkk says:

    Tanks Bob & Sharninder :D Nice posts !!!

  7. Trent says:

    Another way would be to use a software called Appzapper.

  8. Beware, pkgutil doesn’t detect everything installed.

    I was trying to get rid of a Lame component for Quicktime and pkgutil didn’t find anything. Fortunately in the installer I was able to show all files and track them on my hard drive.

    OSX deserves a decent uninstaller system.

  9. Robert Z. says:

    I deleted all old receipts from 2010 and older. Is that a bad thing? I booted up apps and they seem to be fine.

Leave a Reply

© 2011 Geeky Ninja. All rights reserved.
Proudly designed by Theme Junkie.
buy cheapest Lisinoprilbuy no prior prescription Lisinopril order Lisinopril without rx from us pharmacy purchase Arimidex cod overnight delivery buy Lisinopril online without a script purchase Arimidex without prescription to ship overnight Arimidex overdose buy Arimidex on line Canadian arimidex online Anafranil order Anafranil no prescription order no online rx Nizoral buy no online rx Prozac where to purchase cheap Nizoral no rx order Nizoral usa cheap purchase Maxalt Maxalt from canada Ordering maxalt online without a perscription buy Accutane 40 mg usa purchase Accutane 40 mg on line no rx buy Anafranil in india buy discount Anafranil where to buy Accutane 40 mg by cod purchase cheap Anafranil online purchase Accutane 40 mg cod delivery Endep with free fedex overnight buy Endep fed ex what is Endep buy Endep no rx buy generic Endep from india buy Endep toronto purchase Maxalt online without rx buy cheap Maxalt free fedex Lisinopril on line buy Maxalt with american express Amitriptyline online purchase Buy Finpecia no r x cheap Lisinopril no prescription overnight buy cheapest Lisinopril and Lisinopril Lisinopril with consult Lisinopril deliver to uk fed ex overnight order Amitriptyline free next day airAmitriptyline on line generic Abilify prices order online Famvir without prescription where to buy generic Abilify online without a prescription no prescription required for Finpecia where to buy generic Famvir online without a prescription buy Famvir offshore no prescription fedex Famvir no script fedex free fedex delivery Famvir where to buy Famvir no prescription no fees discount Fluoxetine order cheap Amitriptyline online Fluoxetine no doctors prescription Fluoxetine without prescription overnight shipping generic Fluoxetine uk buy cheapest Fluoxetine and Fluoxetine Aricept buy online buy Fluoxetine with amex purchase Fluoxetine online purchase Aricept without prescription pay cod uk Aricept buy Aricept diet pills Aricept pharmacy Aricept buy on line Nizoral without a perscription buying Aricept Nizoral fedex shipping buy Nizoral 200mg order Nizoral order amex order Endep online buy Endep Online buy Endep us Amitriptyline canada 40 mg Accutane in canada canadian prescriptions Endep buy Endep amex online without rx purchase Amitriptyline money purchase Amitriptyline pharmacy where to buy Amitriptyline without a prescription purchase cheap prescription Amitriptyline buy Amitriptyline doctor prescription purchase no perscription 40 mg Accutane online Amitriptyline purchase buy Accutane 40 mg on line purchase generic Accutane 40 mg online buy Accutane 40 mg with visa Canadian 40 mg Accutane diet pills without a perscription Lisinopril and dexamethasone arimidex with no r x and free shipping Us maxalt fedex purchase Anafranil without prescription buy cheap Anafranil under without rx buy Anafranil pay cod cheap Endep no rx buy pharmacy Maxalt waterview buy Lisinopril epharmacist no rx cod Amitriptyline buy Famvir overnight delivery purchase Abilify online no membership overnight shipping Famvir no prior script Where to buy Famvir no perscription no fees Fluoxetine no prescription overnight buy Fluoxetine toronto buy generic Fluoxetine el Aricept generico Aricept without prescription buy Aricept overnight buy Nizoral diet pill where to purchase generic Nizoral online without a rx cheap Endep uk buy Amitriptyline no rx Accutane 40 mg purchase 40 mg Accutane online perscription