Skip to main content

Manually Updating Alectrona Patch

Use Only for Exceptions

This guide is for remediation and troubleshooting workflows, not normal release rollout.
For the standard release process and channel strategy, see Release Rollout and Update Channels.

There may be situations where you need to manually update Alectrona Patch on your computers, such as:

  • Troubleshooting issues with the automatic update process.
  • Remediating systems that are significantly out of date.

Identifying the Installed Version​

To check the currently installed version of Alectrona Patch on a Mac, you can use the following command in Terminal:

/Library/Application\ Support/Alectrona/Patch/patch --version
Jamf Pro Users

If you're using Jamf Pro, you can also configure a Jamf Pro Extension Attribute to report the installed version of Alectrona Patch for easier inventory management.

Manual Update Methods​

Here are some methods to manually update Alectrona Patch:

The recommended way to manually update Alectrona Patch on a Mac is to leverage the patch command-line tool that comes bundled with Alectrona Patch. You can run the following command in Terminal or via your MDM solution to update to the latest version:

update-alectrona-patch.sh
#!/bin/bash

patchBin="/Library/Application Support/Alectrona/Patch/patch"

# Function to compare the installed patch with the latest version
function patchCompare() {
"$patchBin" compare alectrona-patch --fail 2>&1 >/dev/null
return $?
}

# Ensure the script is run as root
if (( EUID != 0 )); then
echo "This script must be run as root."
exit 1
fi

# Check if Patch is installed
if [[ ! -f "$patchBin" ]]; then
echo "Patch is not installed."
exit 2
fi

# Use compare subcommand to check if the patch is up to date
if patchCompare; then
echo "Patch is already up to date."
exit 0
fi

# Perform the update
echo "Updating Patch to the latest version..."
"$patchBin" install alectrona-patch
if [[ $? -ne 0 ]]; then
echo "Patch update failed."
exit 5
fi

echo "Patch installation completed successfully."

# Verify the update
if patchCompare; then
echo "Patch was successfully updated to the latest version."
exit 0
else
echo "Patch was not updated to the latest version."
exit 6
fi

exit 0