How to extract contents from 'Payload' file in a apple macOS update package?

前端 未结 2 382
灰色年华
灰色年华 2020-12-13 14:05

I am extracting macOS sierra update package - macOSUpd10.12.1.pkg using following command to /tmp/macosupd directory.

pkgutil --expand /Volumes/         


        
相关标签:
2条回答
  • 2020-12-13 14:39

    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
    
    0 讨论(0)
  • 2020-12-13 14:53

    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.

    0 讨论(0)
提交回复
热议问题