Skip to main content
Solved

Dockutil wont install to system

  • February 4, 2026
  • 4 replies
  • 32 views

Forum|alt.badge.img+1

Trying to install Dockutil during JSM but it fails. Based off the logs its because its attempting to install to the system (/usr/local/bin). My pkg was created in Composer with the appropriate R/W permissions applied to all elements of the pkg but still no luck. Any help is appreciated!

Best answer by mvu

We install the Dockutil package okay during JSM installation. If you use a vanilla package from Dockutil 3.1.3? Does it work?

https://github.com/kcrawford/dockutil/releases/tag/3.1.3

4 replies

mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • Answer
  • February 4, 2026

We install the Dockutil package okay during JSM installation. If you use a vanilla package from Dockutil 3.1.3? Does it work?

https://github.com/kcrawford/dockutil/releases/tag/3.1.3


Forum|alt.badge.img+1
  • Author
  • New Contributor
  • February 4, 2026

@mvu you know how if you say a word too many times it stops making sense? Thats how my brain became with this issue. I could have sworn i tried just the vanilla pkg and it failed, but this time around it worked. Thank you for the sanity check!


Jared_Y
Forum|alt.badge.img+14
  • Jamf Heroes
  • February 4, 2026

I know you are trying to do this with JSM but you could also install it with Installomator after enrollment. 

Or you can try this script here. It has some checks and balances to install dockutil then refresh the dock with whatever apps you want. Just edit below # variables and applications array under the dockApps=( array.

#!/bin/sh

# # # # # # # # # # # # # # #
# Verify Dock is running #
# # # # # # # # # # # # # # #

dockProcess=$(pgrep -l "Dock")
until [ "$dockProcess" != "" ]; do
echo "$(date "+%a %h %d %H:%M:%S"): Dock process not found. Waiting."
sleep 2
dockProcess=$(pgrep -l "Dock")
done
echo "$(date "+%a %h %d %H:%M:%S"): Dock is running. Lets continue."

# # # # # # # # # # # # # # # # #
# Verify User is Logged in #
# # # # # # # # # # # # # # # # #

currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )

while true
do
if [[ $currentUser == "root" ]] || [[ $currentUser == "_mbsetupuser" ]] || [[ $currentUser == "loginwindow" ]]; then
echo "currentUser is $currentUser"
sleep 2
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
else
break
fi
done
echo "currentUser is now $currentUser"



# # # # # # # # # # # # # # # # # # # # #
# Install dockutil if not installed #
# # # # # # # # # # # # # # # # # # # # #

# Get the URL of the latest PKG From the Dockutil GitHub repo
url=$(curl --silent --fail "https://api.github.com/repos/kcrawford/dockutil/releases/latest" | awk -F '"' "/browser_download_url/ && /pkg\"/ { print \$4; exit }")
# Expected Team ID of the downloaded PKG
expectedTeamID="Z5J8CJBUWC"
# Check for Dockutil and install if not found
if [ ! -e "$dockutil" ]; then
echo "Dockutil not found. Installing."
# Create temporary working directory
tempDirectory=$( /usr/bin/mktemp -d "/private/tmp/dockutil.XXXXXX" )
echo "Created working directory '$tempDirectory'"
# Download the installer package
echo "Downloading Dockutil package"
/usr/bin/curl --location --silent "$url" -o "$tempDirectory/Dockutil.pkg"
# Verify the download
teamID=$(/usr/sbin/spctl -a -vv -t install "$tempDirectory/Dockutil.pkg" 2>&1 | awk '/origin=/ {print $NF }' | tr -d '()')
echo "Team ID for downloaded package: $teamID"
# Install the package if Team ID validates
if [ "$expectedTeamID" = "$teamID" ] || [ "$expectedTeamID" = "" ]; then
echo "Package verified. Installing package Dockutil.pkg"
/usr/sbin/installer -pkg "$tempDirectory/Dockutil.pkg" -target /
else
echo "Package verification failed before package installation could start. Download link may be invalid. Aborting."
exit 1
fi
# Remove the temporary working directory when done
echo "Deleting working directory '$tempDirectory' and its contents"
/bin/rm -Rf "$tempDirectory"
else
echo "Dockutil already found."
fi



# # # # # # # # # # # # #
# dockutil commands #
# # # # # # # # # # # # #

# get current user info
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ && ! /loginwindow/ { print $3 }' )

# global check if there is a user logged in
if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then
echo "no user logged in, cannot proceed"
exit 1
fi

# variables and applications array
plist="/Users/$currentUser/Library/Preferences/com.apple.dock.plist"
dockutil=/usr/local/bin/dockutil
dockApps=(
"/System/Applications/Launchpad.app"
"/System/Applications/Calendar.app"
"/Applications/Google Chrome.app"
"/System/Applications/Reminders.app"
"/Applications/Slack.app"
"/Applications/zoom.us.app"
"/Applications/Self Service.app"
"/System/Applications/System Settings.app"
"/System/Applications/System Preferences.app"
)

# get the current user's UID
uid=$(id -u "$currentUser")

# function to run a command as the current user
# runAsUser command arguments
runAsUser() {
if [ "$currentUser" != "loginwindow" ]; then
launchctl asuser "$uid" sudo -u "$currentUser" "$@"
else
echo "no user logged in"
# uncomment the exit command to make the function exit with an error when no user is logged in
# exit 1
fi
}

#clear current dock and add apps to dock
runAsUser $dockutil --remove all --no-restart $plist; sleep 2
for app in "${dockApps[@]}";
do
if [[ -e ${app} ]]; then
runAsUser "${dockutil}" --add "$app" --no-restart "${plist}";
else
echo "${app} not installed"
fi
done

#restart Dock
killall -KILL Dock

exit 0

 


mvu
Forum|alt.badge.img+20
  • Jamf Heroes
  • February 4, 2026

@nickconway1 No worries. I’ve been there many times as well.