LinuxCommandLibrary

pkgutil

TLDR

List installed packages

$ pkgutil --pkgs
copy
Show package info
$ pkgutil --pkg-info [com.apple.pkg.Safari]
copy
List package files
$ pkgutil --files [com.apple.pkg.Safari]
copy
Verify package
$ pkgutil --verify [com.apple.pkg.Safari]
copy
Forget package
$ sudo pkgutil --forget [com.example.package]
copy

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
copy

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.

SEE ALSO

installer(8), lsbom(1), pkgbuild(1)

Copied to clipboard