pkgutil
TLDR
List installed packages
$ pkgutil --pkgs
Show package info$ pkgutil --pkg-info [com.apple.pkg.Safari]
List package files$ pkgutil --files [com.apple.pkg.Safari]
Verify package$ pkgutil --verify [com.apple.pkg.Safari]
Forget package$ sudo pkgutil --forget [com.example.package]
SYNOPSIS
pkgutil [options] [packages]
DESCRIPTION
pkgutil is macOS's package receipt utility. It queries the package database, verifies installations, and manages package receipts without removing files.
PARAMETERS
--pkgs
List all packages.--pkg-info id
Show package information.--files id
List installed files.--verify id
Verify package installation.--forget id
Remove package receipt.--expand pkg dir
Expand package.--volume path
Target volume.
EXAMPLES
$ # List all Apple packages
pkgutil --pkgs | grep com.apple
# Get package details
pkgutil --pkg-info com.apple.pkg.Safari
# List package files
pkgutil --files com.apple.pkg.Safari | head
# Find package owning file
pkgutil --file-info /usr/bin/python3
# Expand pkg for inspection
pkgutil --expand package.pkg expanded_dir
pkgutil --pkgs | grep com.apple
# Get package details
pkgutil --pkg-info com.apple.pkg.Safari
# List package files
pkgutil --files com.apple.pkg.Safari | head
# Find package owning file
pkgutil --file-info /usr/bin/python3
# Expand pkg for inspection
pkgutil --expand package.pkg expanded_dir
CAVEATS
macOS-specific. --forget doesn't uninstall, only removes receipt. Some packages are protected.
HISTORY
pkgutil is Apple's command-line interface for the macOS Installer package system, managing .pkg installations.


