Utilizing Softwareupdate Command

Ricky
Contributor

Hello Everyone,

I have been using the built in macOS update function to get devices from 10.13.5 to 10.13.6 via Terminal. I figured I could create a policy that uses executes the command

sudo softwareupdate -iaR

in order to pull down the OS upgrade and also whatever is sitting in the App Store in a pending state. For some reason I am having no luck. For reference, this works fine via Terminal as well as pushing out a UNIX command in ARD.

5 REPLIES 5

bpavlov
Honored Contributor

What do you mean by having no luck? What's happening?

Also you do not need sudo in your command. Jamf runs policies with root privileges already.

BOBW
Contributor II

I found using :

#!/bin/sh
softwareupdate -ia -R

works better

AVmcclint
Honored Contributor

I have seen that if I don't specifically download the updates first before running the -ia switch, it might sometimes fail. What I've done is create a policy that runs in the background to only run softwareupdate -d -a at check in. This makes sure that the applicable updates are already waiting to be installed and it means the user doesn't have to wait for the downloads. Then I put a policy in Self Service that runs softwareupdate -i -a That makes the process visible to the user go faster. I will have to remember the -R switch once we go to 10.13.

bpavlov
Honored Contributor

@Ricky @BOBW @AVmcclint Since we're on the topic, figured I'd plug this feature request: https://www.jamf.com/jamf-nation/feature-requests/7285/add-softwareupdate-restart-support which deals with this new flag in 10.13.4+.

BOBW
Contributor II

upvoted the feature request :)