Process for upgrading all Macs to 10.12.5

bbot
Contributor

Our environment wants us to upgrade all Macs to 10.12.5 (~300 machines)

We've previously cached the package on user's machines, then allow them to upgrade through Self Service.

How are some of you forcing 10.12.5 updates for the user's that do not want to do it self service?

1 ACCEPTED SOLUTION

znilsson
Contributor II

I'm using the macOSUpgrade script here:

macOSupgrade

Just go through and make sure the variables are all good, etc. You can just run this in a policy.

View solution in original post

13 REPLIES 13

znilsson
Contributor II

I'm using the macOSUpgrade script here:

macOSupgrade

Just go through and make sure the variables are all good, etc. You can just run this in a policy.

bbot
Contributor

That's awesome. Looks like I can cache the installer early on the machines that need it, and have them run it in self service until a specified date... then after the date, I can run this as a policy on recurring check-in.
Thanks!

scottb
Honored Contributor

Am I the only one that is getting circular URL run-arounds in some of the posts here? Clicking on the URL above posted by @znilsson , I just get a new page with this page...
Used three browsers with the same results (yes, I can search git for the appropriate article).

bbot
Contributor

@scottb I had the same issue. Thought my computer was broken for a minute. I ended up copying and pasting his link and it worked.

scottb
Honored Contributor

@bbot yes, I do that too...but we shouldn't have too ;)

znilsson
Contributor II

Sorry, I accidentally swapped the URL and the URL text in my original link. I fixed it.

GabeShack
Valued Contributor III

I keep having an issue on my desktop computers with this script stating its not plugged into power and/or doesn't have 15gb free. Wondering if anyone else has seen this.

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

znilsson
Contributor II

@gshackney The log should be echoing the specific reason. The AC power detection line in the script is this:

/usr/bin/pmset -g ps

Just run that in Terminal on one of your desktop Macs. I'm on a Mini, and the result for that line on mine is "Now drawing from 'AC Power'". The script uses wildcards around "AC Power" to determine if you're connected to power or not, so if you're on a desktop, you should be getting the result Now drawing from 'AC Power' and consequently should not be throwing the "not plugged into power" error.

The free space section first checks to see if you're on 10.12 or not, then runs this:

/usr/sbin/diskutil info /

So same thing, try running that on one of your desktop Macs in Terminal. The script makes an adjustment for the line it looks for via grep depending on if you're on 10.12 or 10.11 or lower, because Apple changed the wording. In 10.12 it's "available space" and prior to that it was "free space".

But the script should report either one correctly as it checks the OS version first. Regardless, run the above command on one of your desktop Macs and look for the "Volume Available Space" line, if you're on 10.12.x. The script looks at the end of the line for the percentage of free space, and if that number is <15% then it throws the error.

timwillmore
New Contributor

@Rosko is the original author of the script. Maybe he can shed some light on issues as well?

a_stonham
Contributor II

If any one else is having issues one machines that have over a TB of free space reporting under 15GB
Replace the free space check with

##Check if free space > 15GB
freeSpace=$( df -g / | grep "/dev/" | awk '{print $4}' )

Rosko
Contributor II
Contributor II

Interesting @a.stonham ...I've never ran into this as none of my machines have over a TB of disk space. I will do some testing and update the workflow on GitHub.

Excellent find! If you have any other gotchas, feel free to contribute on GitHub.

@gshackney did that fix the issue for you?

GabeShack
Valued Contributor III

Yes it did when I replaced the lines under check if free space with:

##Check if free space > 15GB
freeSpace=$( df -g / | grep "/dev/" | awk '{print $4}' )
if [[ ${freeSpace%.*} -ge 15 ]]; then
    spaceStatus="OK"
    /bin/echo "Disk Check: OK - ${freeSpace%.*}GB Free Space Detected"
else
    spaceStatus="ERROR"
    /bin/echo "Disk Check: ERROR - ${freeSpace%.*}GB Free Space Detected"
fi

Seemed to continue without issue.

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

bbot
Contributor

When I use /usr/sbin/diskutil info / | grep "Available Space" | awk '{print $4}', i get 155.9

When I use df -g / | grep "/dev/" | awk '{print $4}', I get 144.

Any idea why there's a difference in available free space?