Problem deploying a package with installer

kenneth81
New Contributor II

Hello, I'm trying to deploy a package with the installer command and i"m getting some errors. I've tried doing cd /tmp as the other issue suggested but that still wouldn't work.

 

Currently I have a policy that caches the package on the endpoint at a location I assume was /Library/Application Support/JAMF/Downloads

Then a script that copies that to /tmp and tries to run installer on it. Here is the output:

 

Script result: cp: /Library/Application Support/JAMF/Downloads/filename.pkg: No such file or directory
Feb 14 12:10:13 installer[4032] <Critical>: PFPkg: No file found at path: /private/tmp/filename.pkg Feb 14 12:10:13 installer[4032] <Critical>: PFPackage::packageWithURL - can't instantiate package: /private/tmp/filenamepkg installer: Error - the package path specified was invalid: 'filename.pkg'.

 

 

Firstly, from the output I assume the cache location is wrong, but also why is it looking at /private/tmp instead of /tmp?

 

Here is the script as well:

 

#!/bin/bash
# Find the pkg on your machine and cd to it.
filename=$4
cd /tmp
cp "/Library/Application Support/JAMF/Downloads/$filename" "/private/tmp"
# Create the config for it.
echo $filename > filename.txt
installer -verbose -pkg $filename -target '/' -dumplog

 

 

Any ideas what could be going wrong?

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

As @mickl089 mentions, if you're talking about a standard Apple pkg format, these deploy natively in Jamf Pro without needing to cache and then run a script, but perhaps there's some reason that so clear on why you're attempting to do it this way.

BTW, packages cached with Jamf Pro go into /Library/Application\ Support/JAMF/Waiting\ Room/

Also, /private/tmp and /tmp are the same location. It's just that using /tmp/ in a script will resolve properly to /private/tmp/ which is it's actual path.

View solution in original post

4 REPLIES 4

mickl089
Contributor III

Is this a PKG you want to deploy? If so, you don't need a script at all, or why do you want to solve it this way?

kenneth81
New Contributor II

I have to deploy it with a script because the package requires some extra config files that i excluded from this post

mm2270
Legendary Contributor III

As @mickl089 mentions, if you're talking about a standard Apple pkg format, these deploy natively in Jamf Pro without needing to cache and then run a script, but perhaps there's some reason that so clear on why you're attempting to do it this way.

BTW, packages cached with Jamf Pro go into /Library/Application\ Support/JAMF/Waiting\ Room/

Also, /private/tmp and /tmp are the same location. It's just that using /tmp/ in a script will resolve properly to /private/tmp/ which is it's actual path.

kenneth81
New Contributor II

Seems like that worked. I change the cp command to point to waiting room instead and it has successfully ran the script! Thank you