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.
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
- ZIP vs RAR
- ZIP vs 7z
- RAR vs 7z
- tar.gz vs tar.xz
- tar.xz vs tar.zst
- gzip vs Zstandard
- 7-Zip vs WinRAR
- 7-Zip vs PeaZip
- Keka vs The Unarchiver
- ZIP vs tar.gz
- XZ vs Zstandard
- LZ4 vs Snappy
- bzip2 vs bzip3
- ISO vs IMG
- Parquet vs ORC
- VMDK vs qcow2
- APK vs AAB (Android App Bundle)
- CAB vs MSI
- DEB vs RPM
- Flatpak vs Snap
- AppImage vs Flatpak
- 7z vs ZPAQ
- Borg vs restic
- EPUB vs MOBI