4

Most apps come packaged in a .dmg file, where once mounted all you have to do is copy the .app, special directory to you Applications folder and that's it. Nice and clean, if you ever want to uninstall the app, you just remove it.

However, what about .pkg files? I know there are some commercial solutions, but really, that's not to satisfactory.

1
  • 3
    If you encounter .pkg files without a corresponding uninstaller, please contact the developer and ask them. Mar 6, 2020 at 5:46

2 Answers 2

4

Each .pkg file generally differ in where they install the files, so unlike a .app bundle, there is no generalized way to uninstall the contents of a .pkg file.

A .pkg file is an installer package. It is run with the help of the macOS built-in Installer app, and allows the installation of the files contained under the package under various directories as programmed by the developer of the software.

Here's are a bunch of approaches that can be tried:

  1. Check the .pkg file and any associated files provided by the developer. Sometime, such software package also come with either a dedicated or a built-in uninstaller. Running the uninstaller generally takes care of uninstalling the files/apps installed by the package.

    If you don't find any obvious uninstaller, consider contacting the developers of the app and ask them.

  2. Use a 3rd party utility such as AppCleaner to uninstall the .pkg installed app. It gives you a simple interface to look through and select from all the installed apps, locates all the files associated with an app, and let you uninstall the app(s) completely.

    From the app website:

    AppCleaner is a small application which allows you to thoroughly uninstall unwanted apps.

    Installing an application distributes many files throughout your System using space of your Hard Drive unnecessarily.

    AppCleaner finds all these small files and safely deletes them.

    Simply drop an application onto the AppCleaner window. It will find for the related files and you can delete them by clicking the delete button.

  3. Prefer using Homebrew Cask to install the desired GUI app(s), if the developers is distributing them via Homebrew. To use Homebrew Cask, start by installing Homebrew and then run brew cask to install Homebrew Cask.

    To see if an app is available via Homebrew Cask, simply run the following command to search the Homebrew database:

    brew search <app_name> --casks
    

    where <app_name> is full or partial name of the desired (GUI) app.

    Homebrew Cask lets you easily install an app by running:

    brew cask install <app_name>
    

    To uninstall an app installed via Homebrew Cask, run:

    brew cask uninstall <app_name>
    

    To unconditionally remove all files associated with the given app which is installed via Homebrew Cask, run:

    brew cask zap <app_name>
    

    Make sure to update the Homebrew's local repository of all the available packages by running the following command, before attempting to search for and install packages:

    brew update
    
2
  • 1
    I'm deeply suspicious of the merits of AppCleaner. Such apps have a track record of deleting the wrong thing, still not deleting the required things, and of sloppy practices. Much better would be to use Pacifist to inspect the package and see what it installed and where.
    – benwiggy
    Mar 6, 2020 at 11:27
  • How does AppCleaner know which files to delete?
    – sunknudsen
    Apr 16, 2020 at 12:34
0

The common practice is for the app developers to provide an uninstall-xyz.pkg, especially if the app installs some privileged helpers or other files outside of its /Applications/AppName.app folder.

If there are no uninstall packages or scripts provided by the app developer, then you can unpack the pkg file and see what's inside it. An easier alternative is to use an app that can peek inside a .pkg and show you what files are copied where and what pre- and post-install scripts are run. This can be done for example with SuspiciousPackage (freeware) or Pacifist (nagware).

With SuspiciousPackage pressing Space (or QuickView) in Finder on a .pkg file will show something like this:

enter image description here

From this screen you can further navigate to inspect the files in the package as well as the preinstall/postinstall scripts.

Additionally, Pacifist has an option to Analyze Existing Installations which will let you inspect what a package had installed even if you don't have the original .pkg at hand.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .