Skip to content

Lesson 6 of 9 · 26m

Packages, Homebrew, Munki, and Software Distribution

Choose the right distribution primitive for apps, command-line tools, and fleet-managed software while preserving signatures and repeatability.

Software distribution fails when teams mix installation models without admitting it. A drag-and-drop app, a signed installer package, a Homebrew cask, a Python tool, and a browser extension are not the same artifact and should not share one sloppy pipeline. The practitioner asks two questions first: what artifact updates this software? and who owns the update lifecycle?

Installer packages are still the enterprise primitive

A .pkg can carry payloads, scripts, version metadata, receipts, and distribution logic. Build a component package with pkgbuild:

pkgbuild   --root ./payload-root   --identifier org.example.inventoryagent   --version 1.4.2   --install-location /   --sign "Developer ID Installer: Example Org (TEAMID)"   inventory-agent-1.4.2.pkg

For a multi-package installer, use productbuild with a distribution XML. Inspect receipts after installation:

pkgutil --pkgs | grep example
pkgutil --pkg-info org.example.inventoryagent
pkgutil --files org.example.inventoryagent | head

Homebrew is excellent and also not MDM

Homebrew is the right answer for many admin workstations and development tools:

brew install jq shellcheck mas
brew install --cask rectangle keepingyouawake

It becomes dangerous when treated as an uncontrolled system package manager across a fleet. brew assumes a writable Homebrew prefix, a user or service ownership model, network access, and update timing. If security policy requires signed, versioned artifacts and centralized reporting, use MDM-delivered packages or a managed distribution layer.

Munki is the mature fleet-oriented model

Munki treats software as manifests, catalogs, pkgsinfo metadata, and managed installs or removals:

<dict>
  <key>name</key><string>Firefox</string>
  <key>version</key><string>133.0.3</string>
  <key>installer_item_location</key><string>apps/firefox/Firefox-133.0.3.dmg</string>
  <key>minimum_os_version</key><string>13.0</string>
  <key>installs</key><array><dict>
    <key>CFBundleIdentifier</key><string>org.mozilla.firefox</string>
    <key>path</key><string>/Applications/Firefox.app</string>
    <key>type</key><string>application</string>
  </dict></array>
</dict>

The value is not only installation. It is controlled rollout, optional installs, unattended execution, dependency ordering, and reporting. AutoPkg can automate upstream download and packaging, but review recipes and trust the code-signing verification chain.

Know the artifact type

An app in a DMG, a package with receipts, a Homebrew formula or cask, and a language-runtime dependency each have different ownership, verification, and update lifecycles. Write that ownership down in the software catalog.

Field notes

  • Test install, upgrade, downgrade behavior, and removal. Most pipelines test only first install.
  • Installer preinstall and postinstall scripts run as root. Treat them as privileged code and keep them small.
  • Do not staple random downloaded DMGs into production because they opened successfully on one machine.
  • Version numbers in filenames are not inventory truth. Read bundle versions, receipts, and signatures.

Was this lesson helpful?

Sign in to rate