← Back to Uninstall on Mac

What Is a PKG File on Mac, and How to See What It Installed

What is a PKG file? It is a macOS installer package: one file that Apple's Installer app opens to copy an app and its supporting files into place, sometimes outside Applications, and sometimes to run setup scripts. After it installs, macOS keeps a receipt of what it placed, which pkgutil in Terminal can list before you remove the app.

What is a PKG file on Mac?

A .pkg file is an installer package. To install a pkg on Mac, double-click it: Apple's Installer app opens, walks you through a few screens and usually asks for an administrator password. Installer is built into macOS, so there is nothing to download.

Apple's guide to installing apps from the internet tells you to double-click "the disk image or package file (looks like an open box)" in your Downloads folder. That open box icon is the quickest way to spot a pkg file on Mac.

Apple's developer guide to packaging Mac software says an installer package is the best choice when a product has several parts, must copy files to specific places, or needs to run code during installation. Packages can also be signed, which protects their contents from being changed after signing.

Inside, a .pkg is one archive holding the files, a list of them and any scripts. To compare the formats: the .app is the app itself, a .dmg is a disk image you usually drag the app out of, and a .pkg runs an installer that can place files beyond Applications. If you know Windows, a Mac .pkg plays roughly the role an .msi installer plays there, but it is built for the macOS Installer and does not install on Windows.

Where a PKG installer can put files on your Mac

A drag install puts one .app in Applications. A package puts every file it carries wherever the package says. That is why dragging a package-installed app to the Trash can leave parts of it behind.

There are limits. Apple's article on System Integrity Protection lists /System, /usr, /bin, /sbin and /var as protected, and names /Applications, /Library and /usr/local as places third-party apps and installers can still write to. A third-party package cannot change the protected folders, and you should never try to either.

Common places a package puts things:

  • The app: in /Applications.
  • Background helpers: launch daemons and agents in /Library/LaunchDaemons and /Library/LaunchAgents. They appear under Login Items & Extensions in System Settings, as the guide to stopping apps from opening on startup explains.
  • Shared support files: a vendor folder inside /Library/Application Support/.
  • Drivers and plug-ins: Steam's optional Steam Streaming Audio package installs two drivers in /Library/Audio/Plug-Ins/HAL, SteamStreamingMicrophone.driver and SteamStreamingSpeakers.driver, as the guide to uninstalling Steam on Mac shows.
  • Runtimes: Java installers put each JDK in its own folder in /Library/Java/JavaVirtualMachines.
  • Command-line tools: /usr/local, the one part of /usr that Apple's article says installers can still write to.

If an app came with an uninstaller, start there: Apple's page on how to delete or uninstall apps on Mac says that is the best way to remove an app along with any login items, extensions or other data it might have stored elsewhere.

What is a PKG file: an open box sending items to separate trays, like an installer placing files in several folders
One package can send its parts to several folders at once.

How to see what a PKG will install before you install it

You can look inside a package first. Nothing in this section changes your Mac.

  1. In Installer. Double-click the package, and before you click Install, choose File > Show Files to see the list of files it will install. Where the Installation Type step shows a Customize button, clicking it lists the package's parts and lets you untick optional ones. If Show Files is dimmed for a package, use the Terminal option in the next step.
  2. In Terminal. Open Terminal and run pkgutil --payload-files ~/Downloads/Example.pkg. It lists the files inside a package you have not installed. The pkgutil manual page (run man pkgutil in Terminal) notes that it cannot know where those files will land, so treat the paths as relative.
  3. Check who signed it. Run pkgutil --check-signature ~/Downloads/Example.pkg. It shows whether the package is signed, by whom, and the certificate chain behind it. A notarized package also shows Notarization: trusted by the Apple notary service.
  4. Optional: unpack it. pkgutil --expand ~/Downloads/Example.pkg ~/Desktop/Example-expanded unpacks the package's parts into a new folder, so its setup scripts can be read as plain text. Never run anything from that folder.

macOS checks packages too. Apple's page on how to safely open apps on your Mac says macOS checks the Developer ID signature of installer packages from outside the App Store, to confirm they come from an identified developer and have not been altered. Notarization means Apple also checked the software for known malware.

If macOS warns that a package is from an unknown developer, read Apple's page on opening an app from an unknown developer first. Apple says the safest approach is to look for a version of the app in the Mac App Store or for an alternative app. Leave your security settings as they are.

Closed box beside its contents laid out on a tray under a loupe, like previewing a pkg file on Mac before you install
Show Files and pkgutil show a package's contents before you install it.

How to see what a PKG installed: reading its receipt with pkgutil

When Installer finishes, macOS records a receipt for each package: its ID, version, install location and the list of paths it placed. The pkgutil manual page says receipt storage can change, so always read receipts with pkgutil. Every command below is read-only and needs no sudo.

  1. Find the package ID. Run pkgutil --pkgs | grep -i vendorname, swapping in the vendor's name. IDs are reverse-DNS names, such as com.valvesoftware.SteamStreamingAudio for Steam or com.google.drivefs.shortcuts in the guide to uninstalling Google Drive on Mac. The many com.apple.pkg entries belong to macOS and Apple's apps, so leave them alone unless Apple's own instructions say otherwise, as they do for the Command Line Tools. The guide to finding apps on Mac uses the same list.
  2. Read its details. Run pkgutil --pkg-info PACKAGE-ID with an ID from step 1. It prints five fields: package-id, version, volume, location and install-time. Apple's page on installing the Command Line Tools uses this command, and its example for com.apple.pkg.CLTools_Executables shows volume: / and location: /. Your version and install time will differ.
  3. List what it placed. Run pkgutil --files PACKAGE-ID. Add --only-files to skip folders, or add | grep -v '\.app/' to hide the thousands of lines inside an app bundle, so the app shows up as one item.
  4. Turn each line into a real path. Lines have no leading slash, because they are relative to the volume and location from step 2. With location /, a line such as Library/Example/Helper means /Library/Example/Helper. With location Applications, a line such as Example.app means /Applications/Example.app. When the location is the app itself, the lines start with Contents, which is why step 2 comes first.
  5. Work backwards from a stray file. Run pkgutil --file-info /path/to/item to see every package ID that lists that path. If more than one package lists a folder, it is shared, so leave it unless you are removing all of them.

The pkgutil commands at a glance:

Command What it shows Does it change anything?
pkgutil --pkgs Every package ID recorded on the startup disk No
pkgutil --pkg-info PACKAGE-ID Version, volume, location and install time No
pkgutil --files PACKAGE-ID Each path it installed, relative to its location No
pkgutil --file-info PATH Which package or packages installed that path No
pkgutil --payload-files FILE.pkg Files inside a package you have not installed No
pkgutil --check-signature FILE.pkg Who signed the package, and whether the signature is valid No
sudo pkgutil --forget PACKAGE-ID Removes the receipt only, never the files Yes, and it cannot be undone
Blank receipt strip linked by threads to a row of items, showing how pkgutil lists what a package installed
A receipt records what the package placed. It is not the files themselves.

What a receipt does not show

  • Files the app makes later. Settings, caches and containers that the app creates in ~/Library after it first opens are not in the receipt, because the package did not install them. Files an install script creates on its own may be missing too. To open ~/Library and look, see how to show hidden files on Mac.
  • Whether the files still exist. A receipt can outlive the files. The guide to uninstalling Java on Mac notes that macOS keeps an install receipt for each package even after its files are gone, so check that each path exists before you act on it.
  • Which folders it owns. Receipt lists can include folders the package did not create and does not own, such as Applications, Library and Library/Application Support. Never delete a folder just because it appears in the list.

How to uninstall a PKG on Mac safely

macOS has no single undo button for a package. The safe way to uninstall a pkg is the vendor's uninstaller first, then the receipt list and Finder for anything left behind.

  1. Back up first. Make a Time Machine backup before you start. Deleting from /Library needs an administrator password and is permanent once you empty the Trash.
  2. Quit the app and anything it runs. If it will not quit, see how to force quit an app on Mac.
  3. Use the vendor's uninstaller if there is one. Look in the app's folder in Applications, in the app's own menus or settings, and on the vendor's support site. Some packages remove themselves: GlobalProtect, for example, is removed by running its installer package again and choosing Uninstall. If the app is a security, VPN or device management tool, removing it also removes that protection or access, so on a work or school Mac, ask your IT team first.
  4. No uninstaller? Run steps 1 to 4 of the receipt section above and write down the full paths.
  5. Pick only what clearly belongs to the app. That means the .app bundle as one item, plus files and folders named for the app or its vendor, such as Steam's two HAL drivers. Run pkgutil --file-info on any folder you are unsure of. Never delete shared folders (Applications, Library, Library/Application Support or /usr/local itself), anything under /System, or anything from a com.apple receipt unless Apple's own instructions say to. Leave System Integrity Protection on.
  6. Delete in Finder. Choose Go > Go to Folder, paste a path, then drag the item to the Trash. Enter your administrator password when asked.
  7. Remove its login and background items in System Settings > General > Login Items & Extensions (Login Items on Ventura and Sonoma).
  8. Optional: forget the receipt once the files are gone. Run sudo pkgutil --forget PACKAGE-ID (sudo asks for your admin password). The pkgutil manual page says this discards the receipt data but does not touch the installed files. It cannot be undone. Apple's Command Line Tools page uses it to opt out of updates for the tools, as the guide to uninstalling Xcode on Mac walks through. Leaving a receipt in place is harmless.
  9. Empty the Trash and restart. If the Trash will not empty, see how to empty the Trash on Mac.
Tagged items in a wire basket while untagged items stay in a shared organizer, like a safe mac uninstall pkg
Only the app's own items go. Shared folders stay where they are.

Check that nothing from the package is still running

  • After the restart, open Activity Monitor and search for the app or vendor name, as Apple's guide to viewing processes in Activity Monitor shows. Nothing should match.
  • Look again in Login Items & Extensions, using Apple's guide to Login Items and Extensions settings. The app's entries should be gone.
  • In Finder, use Go to Folder on each path you deleted. None of them should open.
  • The receipt stays in pkgutil --pkgs until you forget it. That does not mean the app is still installed.

What to do with the .pkg file in Downloads

The .pkg is only the installer. The app, its receipt and its files live elsewhere, so deleting the package does not uninstall anything. Removing the app does not delete the package either.

Once the app is installed and opens, the package can go to the Trash. Keep it only if you want that exact version, or if the vendor's uninstall option lives inside it, as it does for GlobalProtect. To clear out a pile of old installers at once, see how to delete downloads on Mac.

Frequently Asked Questions

How do I open a PKG file on Mac?

Double-click it in Downloads and Installer opens, then follow the onscreen steps. If it opens in another app, Control-click it and choose Open With > Installer. If macOS will not open it because of the developer, read Apple's page on unknown developers first.

Which app opens PKG files on Mac?

Apple's built-in Installer app, so there is nothing to download. It lives in /System/Library/CoreServices and opens when you double-click a .pkg.

Is it safe to delete .pkg files?

Yes, once the app is installed and works. Deleting the .pkg does not uninstall the app, and the file is not the same thing as the receipt or the files in /Library.

Is a PKG file only for Mac?

On a Mac, a .pkg is Apple's installer package. PlayStation consoles use the .pkg extension for a different format that a Mac cannot install. A Mac .pkg does not install on Windows either.

How do I uninstall a PKG on Mac?

macOS has no single undo for a package. Use the vendor's uninstaller first, then the receipt list to find what is left, and delete only what clearly belongs to the app. pkgutil --forget clears the record, not the files.

Removing other apps from this Mac

Apps installed from a package are the ones most likely to leave files outside Applications. These guides cover a few, leftovers included:

Ready for the next one? Browse all the uninstall guides on the blog and follow the same steps for every app you remove.