Skip to content

Lab Software Update

Software reaches the lab Macs in three hops. An installer is imported into a Munki repository on the admin Mac; publish.sh copies that repository to the lab server; each lab Mac notices the change on its next hourly check and installs it. The whole point is that updating Fusion for the entire lab is a download, one munkiimport, and one ./publish.sh, instead of a trip to every desk.

This page covers two things: rebuilding the admin Mac if it dies, and the routine for adding or updating a title. If you're here for the routine, skip to Add a New Title.

How the Repository Is Organized

Everything is a folder of plain files. Munki has no database.

Folder Contents Who writes it
pkgs/ The installers themselves, named <name>-<version>.pkg munkiimport
pkgsinfo/ One plist per installer describing it: name, version, how to tell if it's installed munkiimport, then you touch it up
catalogs/ Generated index of everything in pkgsinfo/; production is the one clients read makecatalogs (automatic in publish.sh)
manifests/ Which titles go on which Macs; site_default is the one every lab Mac uses manifestutil
icons/ <name>.png, shown in Managed Software Center munkiimport, optional

A title is one piece of software across all its versions, identified by its name (for example fusion). A new version of a title is a new pkg and a new pkginfo with the same name and a higher version; Munki works out the upgrade from there.

Set Up the Admin Mac

Steps are numbered continuously through this page.

  1. Install the Munki tools from the current release. The one .pkg installs the admin tools and the client together. Restart when asked.

  2. Put the tools on your path.

    echo 'export PATH="$PATH:/usr/local/munki"' >> ~/.zshrc && source ~/.zshrc
    munkiimport --version
    
  3. Recover the repository. If the lab server is alive, it has a complete copy of everything except publish.sh:

    mkdir -p ~/munki_repo
    rsync -rltv pi@engineering.local:/srv/munki_repo/ ~/munki_repo/
    

    If the server is also gone, start empty and rebuild it from the installers:

    mkdir -p ~/munki_repo/{catalogs,manifests,pkgs,pkgsinfo,icons,client_resources}
    
  4. Tell munkiimport where the repository is.

    munkiimport --configure
    
    Prompt Response
    Repo URL file:///Users/<your username>/munki_repo (type the real path; ~ is not expanded here)
    pkginfo extension leave blank
    pkginfo editor nano (or your editor's command-line name)
    Default catalog production
    Repo access plugin FileRepo
  5. Give this Mac passwordless SSH to the server.

    ssh-keygen -t ed25519      # skip if ~/.ssh/id_ed25519 already exists
    ssh-copy-id pi@engineering.local
    ssh pi@engineering.local 'echo ok'
    
  6. Create the publish script. It rebuilds the catalogs, mirrors the repository to the server, and sets permissions nginx can read.

    cat > ~/munki_repo/publish.sh <<'SCRIPT'
    #!/bin/zsh
    set -e
    /usr/local/munki/makecatalogs ~/munki_repo
    rsync -rltv --delete \
      --exclude '.DS_Store' --exclude 'publish.sh' \
      ~/munki_repo/ pi@engineering.local:/srv/munki_repo/
    ssh pi@engineering.local 'chmod -R u=rwX,go=rX /srv/munki_repo'
    SCRIPT
    chmod +x ~/munki_repo/publish.sh
    

    This Is Not GNU rsync

    macOS ships openrsync under the name rsync. It does not understand --chmod, and -a would copy each file's mode from the Mac, where a downloaded installer is sometimes 600. The -rltv flags plus the trailing chmod over SSH are what make the files readable by nginx. --delete is intentional: this Mac is the single source of truth.

  7. If you started empty in step 3, create the lab manifest; otherwise skip.

    manifestutil new-manifest site_default
    manifestutil add-catalog production --manifest site_default
    
  8. Publish once to prove the pipeline.

    ~/munki_repo/publish.sh
    curl -sI http://engineering.local/munki/catalogs/production | head -1
    

    Your terminal should look like this: the rsync file list, then HTTP/1.1 200 OK.

Add a New Title

Every title goes through the same five moves: import, touch up the pkginfo, add it to the manifest, publish, confirm on one lab Mac. Updating an existing title is the same minus the manifest step; see Update an Existing Title.

  1. Download the installer. Munki wants a .pkg. Most vendors offer one, and Autodesk's lab install for Fusion is one. A .dmg that contains a .pkg also imports directly.

  2. Import it. The prompts below are in the order munkiimport asks them. Fields marked optional can be left blank by pressing Enter.

    munkiimport ~/Downloads/<installer>.pkg
    
    Prompt Response Notes
    Item name The bare product name, lowercase, no spaces or version: thonny, fusion, prusaslicer Overwrite the suggestion. munkiimport guesses from the filename and usually includes a version or architecture. This value must stay identical across versions; it is how manifests and icons find the title
    Display name The product's proper name: Thonny, Autodesk Fusion What students see in Managed Software Center
    Description One plain sentence: 3D CAD used in the engineering labs Optional. Shown under the display name
    Version Accept the detected value Only correct it if you know the pkg's version metadata is wrong
    Category CAD, Programming, or blank Optional. Only groups items in Managed Software Center; has no effect on what installs where. Avoid class or teacher names here; that's the manifest's job
    Developer Autodesk, or blank Optional. Cosmetic
    Unattended install True Installs without a student clicking anything. Munki still waits if the app is running or a restart is needed
    Unattended uninstall True if the pkg has a clean uninstaller, False for large suites like Fusion Matters only if you later remove the title
    Catalogs production The only catalog clients read
    Import this item? y
    Upload item to subdirectory blank Keeps pkgs/ flat
    Use this directory? (first import only) y Appears once, on an empty repo
    Attempt to create a product icon? y Optional. Harmless if it finds nothing
    Edit pkginfo before upload? N The touch-ups in step 11 are easier afterward
    Rebuild catalogs? y

    Expected Noise on an Empty Repo

    The very first import prints Could not read existing catalogs: Could not read 'all' catalog. That catalog doesn't exist until the first rebuild. Carry on.

    Worked Example: Autodesk Fusion
    Prompt Response
    Item name fusion
    Display name Autodesk Fusion
    Description 3D CAD used in the engineering labs
    Version 2705.1.15 (accepted)
    Category CAD
    Developer Autodesk
    Unattended install True
    Unattended uninstall False
    Catalogs production
    Upload item to subdirectory blank
    Attempt to create a product icon? y
    Edit pkginfo before upload? N
    Rebuild catalogs? y
  3. Touch up the pkginfo. Three things, every time. Set the two variables first; they're used by all three.

    NAME=fusion                                  # the Item name from step 10
    VER=2705.1.15                                # the Version from step 10
    cd ~/munki_repo
    

    Rename the pkg to <name>-<version>.pkg and record the new location. munkiimport keeps the vendor's filename, which for Autodesk contains spaces that break plain URLs.

    OLD=$(ls pkgs | grep -i "$NAME" | grep -v "^$NAME-$VER.pkg$")
    [ -n "$OLD" ] && mv "pkgs/$OLD" "pkgs/$NAME-$VER.pkg"
    /usr/libexec/PlistBuddy -c "Set :installer_item_location $NAME-$VER.pkg" "pkgsinfo/$NAME-$VER"
    

    Add installs if munkiimport didn't. This tells Munki to decide "installed or not" by looking for the application itself, rather than by the package receipt. Students drag apps to the Trash; receipts survive that, and a receipts-only item would never be reinstalled.

    grep -c '<key>installs</key>' "pkgsinfo/$NAME-$VER"      # 0 means add it
    APP="Autodesk Fusion"                                     # app name without .app
    /usr/libexec/PlistBuddy \
      -c 'Add :installs array' \
      -c 'Add :installs:0 dict' \
      -c 'Add :installs:0:type string application' \
      -c "Add :installs:0:path string /Applications/$APP.app" \
      -c "Add :installs:0:CFBundleShortVersionString string $VER" \
      -c 'Add :installs:0:version_comparison_key string CFBundleShortVersionString' \
      "pkgsinfo/$NAME-$VER"
    

    Check the Version Key First

    CFBundleShortVersionString is the usual key, but confirm on a Mac that already has the app: defaults read "/Applications/$APP.app/Contents/Info.plist" CFBundleShortVersionString should print a version in the same style as $VER. If only CFBundleVersion does, use that key in both places above. Comparing the wrong key gives either a perpetual reinstall or a perpetual "already installed."

    Add blocking_applications so Munki won't replace the app while a student has it open; it waits and retries next cycle.

    grep -c '<key>blocking_applications</key>' "pkgsinfo/$NAME-$VER"   # 0 means add it
    /usr/libexec/PlistBuddy \
      -c 'Add :blocking_applications array' \
      -c "Add :blocking_applications:0 string $APP" \
      "pkgsinfo/$NAME-$VER"
    
  4. Add the title to the lab manifest. New titles only; an updated version of an existing title is already listed.

    manifestutil add-pkg $NAME --manifest site_default
    manifestutil display-manifest site_default
    
  5. Publish, and confirm the server has the whole file.

    ./publish.sh
    curl -sI "http://engineering.local/munki/pkgs/$NAME-$VER.pkg" | grep -i -E 'HTTP|content-length'
    ls -l "pkgs/$NAME-$VER.pkg"
    

    Your terminal should look like this: 200 OK, and the two byte counts match. A 3.8 GB publish over Wi-Fi takes a while; that's the one slow leg.

  6. Confirm on one lab Mac before trusting the hourly cycle. Quit the app first if it's open.

    sudo managedsoftwareupdate -vv --checkonly 2>&1 | grep -i -E "$NAME|install"
    sudo managedsoftwareupdate --installonly
    

    The check should list + <name>-<version> a few lines above the closing Allowing idle sleep / Finishing... / Done. The install runs quietly; Fusion takes several minutes. Afterward the app's About box, or defaults read "/Applications/$APP.app/Contents/Info.plist" CFBundleShortVersionString, shows the new version.

Done

Every other lab Mac picks it up within the hour, provided the app isn't running there at that moment.

Update an Existing Title

Run these steps on the admin Mac, in one Terminal window. The existing Munki tools and repository are already installed. Use the lab network for publishing and client checks. Stop if a command fails.

  1. Locate and save the existing definition. These are the actual Fusion paths checked on November 16, 2026. On later updates, set OLD to the newest Fusion definition printed by find.

    cd /Users/stevewillis/munki_repo
    find "$PWD/pkgsinfo" -type f -name 'fusion-*' -print
    OLD="$PWD/pkgsinfo/fusion-2705.1.15"
    plutil -p "$OLD"
    plutil -p manifests/site_default
    WORK=$(mktemp -d /tmp/munki-fusion-update.XXXXXX)
    cp "$OLD" "$WORK/previous.plist"
    cp manifests/site_default "$WORK/site_default"
    

    Keep the existing name: fusion. site_default already lists fusion without a version and uses production; leave it unchanged. The current definition uses /Applications/Autodesk Fusion.app, blocks Autodesk Fusion while running, enables unattended installation, and disables unattended uninstallation. It has no custom scripts or installer environment settings; the preservation command below retains any added later.

  2. Download the Mac lab/admin installer from Autodesk's Fusion lab download page. Save it as Autodesk Fusion Admin Install.pkg in Downloads. Use the all-users lab .pkg, not the personal-use downloader .dmg. Autodesk supports deploying this package through Munki; no separate streamer command is needed for this package workflow (lab installation guide).

    INSTALLER="$HOME/Downloads/Autodesk Fusion Admin Install.pkg"
    /usr/local/munki/makepkginfo "$INSTALLER" > "$WORK/installer.plist"
    VER=$(/usr/libexec/PlistBuddy -c 'Print :version' "$WORK/installer.plist")
    printf 'Replacement version: %s\n' "$VER"
    /usr/libexec/PlistBuddy -c 'Print :receipts' "$WORK/installer.plist"
    

    Confirm the receipt is com.autodesk.edu.fusion360 and the version is newer than the existing definition's 2705.1.15. Do not reuse that old version or substitute Fusion's differently formatted marketing version. If Autodesk supplies a different deployment format or receipt, stop and review its installation requirements before using this package procedure.

  3. Import under the existing name. Copy to a versioned filename first; this leaves older installers intact and avoids spaces in the served URL.

    cp "$INSTALLER" "$WORK/fusion-$VER.pkg"
    /usr/local/munki/munkiimport \
      --repo-url file:///Users/stevewillis/munki_repo --plugin FileRepo \
      --name fusion --catalog production "$WORK/fusion-$VER.pkg"
    
    Prompt, if shown Response
    Use existing item as a template? y, only if it is fusion
    Item name / display name fusion / Autodesk Fusion
    Version The replacement version printed above
    Catalogs production
    Import this item? y
    Upload item to subdirectory Leave blank
    Create an icon? n (keep the existing icon)
    Edit pkginfo? n (next step preserves the settings)
    Rebuild catalogs? n (do this after the next step)

    Accept the other existing values. If Munki reports an identical installer already in the repository, stop: this is not a new update. Do not overwrite an existing version's pkginfo or installer.

  4. Preserve settings and update detection. This copies the old definition, replaces only the new package's version, receipts, sizes, hash, location, and import metadata, and advances Fusion's app-version check. It also removes the duplicate identical installs entry in the current definition. Wait until the interactive import has finished and the Terminal prompt returns before pasting this block.

    : "${WORK:?Run step 15 in this Terminal window first}"
    VER=$(/usr/libexec/PlistBuddy -c 'Print :version' "$WORK/installer.plist")
    NEW="/Users/stevewillis/munki_repo/pkgsinfo/fusion-$VER"
    /usr/bin/python3 - "$WORK/previous.plist" "$WORK/installer.plist" "$NEW" <<'PY'
    import copy, pathlib, plistlib, sys
    old_path, fresh_path, new_path = map(pathlib.Path, sys.argv[1:])
    old = plistlib.loads(old_path.read_bytes())
    fresh = plistlib.loads(fresh_path.read_bytes())
    imported = plistlib.loads(new_path.read_bytes())
    assert old['name'] == imported['name'] == 'fusion', 'Wrong item name'
    version = fresh['version']
    assert tuple(map(int, version.split('.'))) > tuple(map(int, old['version'].split('.'))), 'Not a newer version'
    assert {r['packageid'] for r in fresh['receipts']} == {'com.autodesk.edu.fusion360'}, 'Unexpected package'
    result = copy.deepcopy(old)
    for key in ('version', 'receipts', 'installed_size', 'installer_item_size',
                'installer_item_hash', '_metadata'):
        result.pop(key, None)
        if key in fresh:
            result[key] = fresh[key]
    result['installer_item_location'] = imported['installer_item_location']
    installs = []
    for item in result.get('installs', []):
        if item.get('path') == '/Applications/Autodesk Fusion.app':
            key = item.get('version_comparison_key', 'CFBundleShortVersionString')
            item[key] = version
        if item not in installs:
            installs.append(item)
    result['installs'] = installs
    new_path.write_bytes(plistlib.dumps(result))
    print('Updated:', new_path)
    PY
    plutil -lint "$NEW"
    diff -u "$WORK/previous.plist" "$NEW"
    

    diff normally returns status 1 because the files differ. Check that only the package metadata, detection version, and duplicate entry changed. If the replacement specifies new OS/architecture limits or restart requirements, reconcile those with the old definition before publishing. Preserve custom scripts and installer options; revise any embedded version checks to match the replacement. For another title, use its existing name, paths, receipt IDs, and detection rules instead of this Fusion-specific block.

  5. Rebuild catalogs and publish. The existing publish.sh runs /usr/local/munki/makecatalogs ~/munki_repo, mirrors the repository to pi@engineering.local:/srv/munki_repo/, and makes files readable by nginx. Publishing makes the update available to all lab Macs immediately.

    cmp "$WORK/site_default" manifests/site_default
    /Users/stevewillis/munki_repo/publish.sh
    curl -fI http://engineering.local/munki/catalogs/production
    curl -fI "http://engineering.local/munki/pkgs/fusion-$VER.pkg"
    stat -f '%z bytes' "pkgs/fusion-$VER.pkg"
    

    cmp should print nothing. Stop if catalog generation or transfer fails. Both HTTP requests must return 200 OK; the package's Content-Length must match the byte count. Keep the old pkginfo and installer for now.

  6. Verify on one lab Mac. Quit Fusion in every logged-in session. Open Terminal on that Mac and run:

    defaults read /Library/Preferences/ManagedInstalls SoftwareRepoURL
    sudo /usr/local/munki/managedsoftwareupdate -vv --checkonly
    

    The URL must be http://engineering.local/munki. Confirm the pending installs include fusion at the replacement version, then run:

    sudo /usr/local/munki/managedsoftwareupdate --installonly
    /usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' \
      '/Applications/Autodesk Fusion.app/Contents/Info.plist'
    sudo /usr/local/munki/managedsoftwareupdate -vv --checkonly
    

    --installonly installs all pending items, not just Fusion. Allow several minutes. The app version must equal the replacement version, and the second check must no longer offer that Fusion update. Launch Fusion as a student and confirm it opens and signs in. If installation fails, read /Library/Managed Installs/Logs/ManagedSoftwareUpdate.log before continuing.

    Values still checked during the update

    The commands use the verified admin-Mac configuration. The downloaded package determines the new version; a lab Mac confirms the installed version key. The live Pi still needs to pass the transfer and HTTP checks above. Do not prune old versions until the client test succeeds.

Remove a Title

  1. Take it out of the manifest and publish. Existing installs stay on the Macs; Munki simply stops managing them.

    manifestutil remove-pkg $NAME --manifest site_default
    ./publish.sh
    

    To actively uninstall it from the lab as well, use manifestutil add-pkg $NAME --section managed_uninstalls --manifest site_default instead of removing it. That only works for titles imported with Unattended uninstall True and a working uninstall method.

Troubleshooting

Symptom Cause Fix
curl -I on a pkg returns a body of about 146 bytes nginx 404: the filename doesn't match installer_item_location (spaces, vendor name) Redo the rename in step 11, publish
curl -I returns 403 Forbidden File mode 600 reached the server ./publish.sh again; its chmod line fixes it
Client says No changes to managed software but the app is missing Receipts-only pkginfo; the receipt survived a drag to the Trash Add installs (step 11), publish
Client never upgrades, or reinstalls every hour Wrong version_comparison_key See the warning in step 11
-vv --checkonly shows 404s for manifests/<serial>, manifests/<hostname>, or client_resources/site_default.zip Normal: Munki tries per-machine manifests before site_default, and the zip is optional branding we don't use Nothing. A 404 on site_default or catalogs/production is the one that matters
Install skipped with blocking application running The app is open on that Mac Nothing; Munki retries next cycle
rsync: --chmod=...: invalid argument Someone restored a GNU-style publish.sh Use the script in step 6