Why convert PKG to DMG?
Most people do this to repackage software as a drag-to-Applications disk image instead of an installer, or to archive the installed files in a mountable image without running the full installer on the target machine. The .pkg stays intact; only the files are extracted for re-wrapping.
How to convert PKG to DMG
Pacifist APP
Open the .pkg in Pacifist, select the files or app bundle, click Extract to and save to a staging folder, then use Disk Utility's File > New Image > Image from Folder to create a .dmg from that folder.
Disk Utility FREE
After extracting the .pkg contents to a folder via Pacifist or command-line tools, use File > New Image > Image from Folder in Disk Utility to produce a compressed .dmg.
About these formats
A PKG file is a macOS Installer package - it installs software on a Mac. Double-click it to run Apple's Installer app, which will walk you through setup (admin password usually required).…
Open .PKG details →A DMG file is an Apple disk image - the standard container for distributing Mac applications. On a Mac, double-click it to mount the image, then drag the app to your Applications folder. On…
Open .DMG details →Quality & what to watch
- Install scripts (
preinstall,postinstall) from the.pkgdo not run when you extract files directly - apps that require system-level changes, license registration, or helper tools may not work correctly. - The Bill of Materials (BOM) inside the
.pkgrecords exact target paths, permissions, and ownership for every installed file; that information is lost when bypassing the installer. - A
.dmgis a mountable disk image for file distribution, not an installer - it cannot run scripts or manage permissions the way a.pkgdoes.
Frequently asked questions
Why convert PKG to DMG instead of just running the installer?
.pkg installer on the target machine.Will the app work correctly if extracted from a `.pkg` and placed in a `.dmg`?
What command-line tools can do this on macOS?
xar -xf file.pkg to unpack the XAR, cat Payload | gunzip | cpio -id to extract the files, then hdiutil create to produce the .dmg.Should I use DMG or ISO for distributing macOS software?
.dmg - it is the native macOS disk image format. ISO is for optical disc images and is rarely the right format for macOS software distribution.