Convert pkg to tar.gz

Free online PKG to TAR.GZ converter

Repack PKG contents as a portable TAR.GZ archive using local command-line tools.

Convert PKG to TAR.GZ online - free

Uploading…
Selected files exceed the 30 MB total limit. Please select fewer or smaller files.

Your file is processed instantly and deleted as soon as you download it.

How it works

  1. 1/3

    Upload your .pkg file

    Click to browse to select your file you want to convert or simply drag & drop your file into selected area.

  2. 2/3

    Perform .pkg to .tar.gz conversion

    After successful file upload, click to convert when you are ready.

  3. 3/3

    Download converted .tar.gz file

    Conversion result is ready to download.

How to convert pkg to tar.gz file

101convert.com Assistant Avatar

101convert.com assistant bot
1h

A TAR.GZ archive is often required by Unix/Linux tools, source repositories, backup workflows, or systems that cannot read a PKG package directly. The conversion usually means extracting the PKG contents and repacking them as a standard gzip-compressed TAR archive; it does not turn the TAR.GZ file into an installable PKG package.

What the PKG format is

.pkg is used for several package-archive layouts rather than one universal archive specification. A common example is the macOS installer package created by Apple Installer tools such as productbuild; its outer container commonly uses the XAR format and can contain a compressed payload, metadata, and installation scripts. Other Unix systems use PKG archives for software distribution with different internal structures.

You encounter PKG files when downloading macOS software, receiving a Unix software package, or moving an application package between systems. A PKG may contain executable files, documentation, metadata, permissions, ownership information, and scripts. Extracting those files is different from running the package installer.

What the TAR.GZ format is

.tar.gz, also written as .tgz, combines two formats: TAR groups files and directories into one archive, while Gzip compresses that TAR stream. It is widely supported by Linux, macOS, BSD, Unix build systems, deployment tools, and command-line archivers.

TAR.GZ is useful for transferring a directory tree as one file, distributing source code, creating portable backups, and preserving relative paths. It generally stores file metadata more directly than a ZIP archive, but it does not provide PKG installation logic, dependency handling, signing, or installer scripts.

How to actually convert PKG to TAR.GZ

First determine whether the result should contain the original PKG file or the files inside it. The following command creates a TAR.GZ containing the PKG itself:

tar -czf package.tar.gz package.pkg

This is an archive-within-an-archive and does not expose the package contents. To repack the contents, use an extraction directory.

MacOS PKG packages on macOS

  1. Install or otherwise obtain the XAR utility if it is not already available, then create a working directory:
mkdir pkg-work
xar -xf package.pkg -C pkg-work

Inspect the extracted payload:

file pkg-work/Payload

If Payload is a gzip-compressed CPIO archive, extract it into a separate directory:

mkdir extracted
gzip -dc pkg-work/Payload | (cd extracted && cpio -idm)

Create the TAR.GZ from the extracted files:

tar -czf package-contents.tar.gz -C extracted .

This command omits the PKG wrapper, installer metadata, and installation scripts. To preserve those items as well, archive the complete XAR extraction directory instead:

tar -czf package-container.tar.gz -C pkg-work .

Linux or another Unix-like system

Use an archive utility that supports the specific PKG container. For a macOS-style package, install a XAR tool, extract the outer archive, inspect Payload with file, and decode it with the matching utility. If the payload is CPIO compressed with gzip, the same gzip -dc and cpio -idm commands apply. Do not rename .pkg to .tar.gz; changing the extension does not change its format.

Using the built-in online converter

You can convert the file on 101convert.com for free without installing software: upload the PKG, select TAR.GZ as the output, start the conversion, and download the resulting archive. For installer packages containing private files or signing material, use local extraction instead of uploading the package.

Quality, compatibility, and limitations

The result depends on what the converter can parse. A PKG created for one operating system may contain proprietary metadata, scripts, signatures, or a payload compression method that a generic archive tool cannot interpret. If extraction fails, identify the outer format with file package.pkg and use a utility designed for that container.

Repacking can change ownership, permissions, extended attributes, hard links, ACLs, resource forks, timestamps, and symbolic links. To preserve common Unix permissions and links when creating the archive, run:

tar -czpf package-contents.tar.gz -C extracted .

Do not expect the TAR.GZ to install like the original PKG. It contains files for extraction or distribution, while the original package may depend on installer scripts, package receipts, signing verification, destination rules, or system-specific paths.


Note: This pkg to tar.gz conversion record is incomplete, must be verified, and may contain inaccuracies. Please vote below whether you found this information helpful or not.

Was this information helpful?

Frequently asked questions

Is the PKG to TAR.GZ converter free?

Yes, converting PKG to TAR.GZ on 101convert.com is completely free. No registration, email address or installation is required. If you need a higher file size limit or want to convert more files at once, see our plans.

How large can my PKG file be?

You can upload PKG files up to 1000 MB and convert up to 1 files at once in a single batch.

What happens to my uploaded files?

Files are processed automatically and deleted from our servers within a few minutes after conversion. We never view or share your files.

Do I need to install any software to convert PKG to TAR.GZ?

No. The PKG to TAR.GZ conversion runs entirely online in your browser and works on Windows, Mac, Linux, Android and iPhone.

Did the conversion fail?

In most cases, the cause is an incorrect file format. Please upload a valid PKG file for this PKG to TAR.GZ conversion. Occasionally, the issue may be on our side. We analyze recurring conversion failures and disable or fix the converter if we detect a defect.