Skip to content

Instantly share code, notes, and snippets.

@IridiumXOR
Forked from mikolajwojcicki/main.md
Created February 27, 2024 13:44
Show Gist options
  • Save IridiumXOR/ed8532d45ff1f71a4501362771125a00 to your computer and use it in GitHub Desktop.
Save IridiumXOR/ed8532d45ff1f71a4501362771125a00 to your computer and use it in GitHub Desktop.
Extracting apple .pkg files on Linux

In order to extract such a package following software is requried:

  • 7zip for general .pkg

  • pbzx for Payload files Github Source

    • xar Github Source
      • fix
      • download optional dependency libbzip2 / bzip2 and enable it in xar compilation configuration. This enables use or xar for extracting .pkg
    • compile with gcc pbzx.c -o pbzx -llzma -lxar

After all is installed and working, extract .pkg with 7zip, go into extracted directory and go into desired directory containing payload file. Then run pbzx -n /path/to/file | cpio -i in order to extract Payload file

NOTE: Bom files are quite possibly bzip2 compressed / encoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment