https://en.wikipedia.org/wiki/Installer_(macOS)
PKGID="${1:-}" PKG_ROOT="$(pkgutil --pkg-info "$PKGID" \ | awk -F: '/location:/{print $2}' \ | sed -e 's,^[ \t]*,/,')" pkgutil --only-files --files "$PKGID" \ | join_paths_0 "$PKG_ROOT" \ | xargs -0 $dry_run rm -v pkgutil --only-dirs --files "$PKGID" \ | sort -r \ | join_paths_0 "$PKG_ROOT" \ | xargs -0 $dry_run rmdir pkgutil --forget "$PKGID"
https://en.wikipedia.org/wiki/Installer_(macOS)