How do you uninstall .pkg file?

Solution 1:

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