Extract .pkg and .mpkg files with xar on Linux

macOS installer packages have the .pkg extension which are xar archives, to extract them on Linux we need to download and compile xar from https://code.google.com/archive/p/xar/downloads.

Operating system:  Linux Debian 9 / kernel 4.9.0-3-amd64

1. Install dependencies

apt-get install build-essential libxml2-dev libssl1.0-dev zlib1g-dev

2. Download and extract xar-1.5.2.tar.gz

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/xar/xar-1.5.2.tar.gz
tar -zxvf xar-1.5.2.tar.gz

3. Build and install

cd xar-1.5.2
make install

4. Extract files with xar

xar -xvf package_installer.pkg

4 Replies to “Extract .pkg and .mpkg files with xar on Linux”

  1. it does not work:

    apt-get install build-essential libxml2-dev libssl1.0-dev zlib1g-dev

    E: Unable to locate package libssl1.0-dev

  2. Linux Mint 19.3

    my error is ;
    “make: *** No targets specified and no makefile found. Stop.”

    I couldn’t find any specific solution.

  3. Hi Bruno and vokhirion,

    Make sure that the ./configure is finishing successfully.
    In case of an error, you must install the dependencies and retry the ./configure.
    You have to use make and make install only after the ./configure was successfully.

Leave a Reply to bruno Cancel reply

Your email address will not be published. Required fields are marked *