Convert PKG to DEB
Repackage Solaris or macOS PKG contents as a Debian DEB and check Linux compatibility.
Convert PKG files online
We don’t have a dedicated online converter for PKG to DEB yet, but you can convert PKG files online to these formats:
Want to convert PKG to DEB?
Let us know. We pick the conversions to add next by how many people ask for them.
How to convert pkg to deb file
- Archives
- No ratings yet.
.deb package, while software obtained as a .pkg may target Solaris or macOS. Renaming the extension does not convert the package because the archive structure, metadata, scripts, binaries, and operating-system requirements differ.
What the PKG format is
PKG is an extension used by multiple package formats, not one universal archive standard. In the Archives context, the relevant formats are primarily Solaris SVR4 packages and macOS Installer packages.
Solaris packages contain application files, metadata such as pkginfo and pkgmap, dependency information, permissions, and installation scripts. Solaris tools include pkgmk, pkgtrans, and pkgadd. A Solaris package can exist as a directory-format package or as a datastream archive.
macOS packages are commonly produced with productbuild. Their contents can include a distribution definition, component packages, compressed payloads, property-list metadata, and macOS installation scripts. The payload may contain Mach-O executables, frameworks, launchd jobs, and other files that require macOS.
Identify the source operating system before attempting conversion. A .pkg file is an installation package, not an indication that its programs can run on Linux.
What the DEB format is
DEB is the native binary package format for Debian, Ubuntu, Linux Mint, and other Debian-based distributions. Internally, it is an ar archive containing control metadata and a data archive; common members include control.tar.* and data.tar.*.
Debian tools such as dpkg and APT use the metadata to record package names, versions, architectures, dependencies, conflicts, file ownership, and maintainer scripts. A DEB is therefore useful when the destination system requires Debian packaging or when the package must be installed from a private Debian repository.
How to convert a Solaris PKG package
There is no general automatic PKG-to-DEB converter. alien converts formats such as RPM and does not make arbitrary Solaris or macOS packages compatible with Debian. Solaris packages must be unpacked and repackaged, and their binaries may still need to be rebuilt for Linux.
- Work in a Solaris environment, or use an environment containing the Solaris packaging utilities. For a Solaris datastream package, extract it to directory format with a command such as
pkgtrans -x input.pkg /tmp/pkg-extracted. Confirm the exact syntax with the installed system'spkgtransmanual because package source and destination types affect the command. - Inspect
pkginfo,pkgmap, dependency files, documentation, permissions, and request or installation scripts. Treat scripts as code and do not copy Solaris-specific scripts into the Debian package unchanged. - Prepare a staging directory whose layout matches the intended Linux filesystem locations. For example, place an executable in
stage/usr/binand shared data instage/usr/share/example. Remove Solaris-only files and replace incompatible executables with Linux builds. - Create Debian control metadata in
stage/DEBIAN/control. A minimal example is:
mkdir -p stage/DEBIAN
cat > stage/DEBIAN/control <<'EOF'
Package: example
Version: 1.0.0
Section: misc
Priority: optional
Architecture: amd64
Maintainer: Package Maintainer <maintainer@example.org>
Description: Example application repackaged for Debian
Repackaged from a Solaris PKG archive.
EOF
- Build and inspect the package:
dpkg-deb --build stage example_1.0.0_amd64.deb
dpkg-deb --info example_1.0.0_amd64.deb
dpkg-deb --contents example_1.0.0_amd64.deb
Declare actual Debian dependency names in the Depends field, set Architecture to the architecture of the Linux binaries, and preserve executable bits, ownership, and required configuration paths. For a maintained package, create a Debian source tree with debhelper and build it with dpkg-buildpackage rather than relying on a hand-built DEBIAN directory. fpm can create a DEB from a prepared directory with fpm -s dir -t deb, but it does not translate binaries, dependencies, or installation semantics.
How to handle a macOS PKG package
On macOS, inspect a flat package with xar -xf input.pkg or expand it with pkgutil. Examine the payload, component packages, distribution metadata, and scripts before copying anything into a staging directory.
A macOS executable, framework, launch agent, or system integration cannot become a Linux program by placing it in a DEB archive. Repackage a macOS PKG only when it contains a Linux-compatible payload or when you have source code from which to build a Linux version. Otherwise, obtain the vendor's Linux release and package that instead.
Compatibility and testing limits
Repackaging changes the container, not the program. Solaris binaries depend on Solaris interfaces, and macOS binaries depend on Darwin and macOS frameworks. A DEB can install successfully while its executable fails immediately or lacks required services and libraries.
Review every maintainer script before installation because scripts can create users, enable services, alter configuration, and write outside the package's data paths. Test the result in a disposable virtual machine or container, for example with sudo apt install ./example_1.0.0_amd64.deb, and verify execution, upgrades, removal, dependencies, permissions, and service behavior.
Reputable online services generally do not provide a trustworthy automatic Solaris- or macOS-PKG-to-DEB conversion. Uploading proprietary packages can disclose binaries and installation scripts, while a web converter cannot solve operating-system or CPU-architecture incompatibility. Use local tools such as pkgtrans, xar, pkgutil, dpkg-deb, debhelper, or fpm instead.
PKG vs DEB: format comparison
How the PKG and DEB formats compare on the properties that matter most for this conversion.
| Property | .PKG macOS installer package | .DEB Debian binary package |
|---|---|---|
| Compression | Lossless | Both |
| Compression ratio | — | Medium |
| Encryption | No | No |
| Split archives | No | No |
| Recovery record | No | No |
| Operating system support | Limited | Wide |
| Typical file size | Large | Small |
| Open standard | No | Yes |
| Introduced | — | 1995 |
| Developer | Apple | Debian Project |
| MIME type | — | application/vnd.debian.binary-package |
Information about file extensions and file types is provided by File-Extensions.org