← All comparisons

DMG vs macOS PKG

A side-by-side feature comparison.

Summary

DMG and PKG are the two ways software arrives on macOS. A DMG is a disk image you mount and drag the app from; a PKG is an installer that runs scripts and places files at specific paths. Drag-and-drop apps prefer DMG; system-wide tools prefer PKG.

Bottom line: DMG for self-contained apps. PKG when you need install scripts or files outside /Applications.

Feature comparison

Feature DMG (Apple Disk Image) macOS .pkg (flat)
Format Disk image XAR + cpio.gz
Install style User drags app Installer.app runs scripts
Code signing Recommended Required for Gatekeeper
Notarization Required Required
Uninstall Drag to Trash Often requires uninstaller script
Best for GUI apps System extensions, agents

About DMG (Apple Disk Image)

DMG is the Apple Disk Image format used to distribute Mac software. It contains a mountable HFS+/APFS filesystem, optionally compressed and encrypted. Double-clicking a DMG mounts it as a virtual disk so the user can drag the .app bundle into /Applications.

Read the full DMG (Apple Disk Image) guide →

About macOS .pkg (flat)

Modern macOS installer packages are XAR archives containing a Distribution XML, optional pre/post-install scripts, and a Payload that is itself a gzip-compressed cpio archive. pkgutil --expand pulls everything apart for inspection. This is what a Microsoft Office or Google Chrome .pkg installer actually is under the hood.

Read the full macOS .pkg (flat) guide →

More comparisons