I am extracting macOS sierra update package - macOSUpd10.12.1.pkg
using following command to /tmp/macosupd directory.
pkgutil --expand /Volumes/
Since OSX 10.10, the Payload
in the .pkg
files is encoded as pbzx
(which is in turn lzma compressed). It can no longer be extracted using gunzip
. Check out the pbzx tool (a fork of the original which would not allow you to extract the Payload directly but only by passing the .pkg
file directly).
Instead of
tar -xvf macOSUpd10.12.1.pkg/Payload
you can write
pbzx -n macOSUpd10.12.1.pkg/Payload | cpio -i
There is an undocumented option to pkgutil
, --expand-full
, which uses the same syntax as pkgutil --expand
.
pkgutil --expand-full [pkg] [dir]
This will completely "unarchive" a pkg or mpkg file.