Softwareupdate cancelable?

wstewart3
New Contributor III

I have a working process for osx updates.  I'm using an extension attribute to verify if a computer has any updates, and if so if they require an update or not.

 

I then just the Jamf helper to create a nice dialogue with a countdown timer.  And I fire off a:

softwareupdate -i -a -R --force

Which works well, but I have found in certain situations, like having a terminal open, cancelling to closing, cancels the reboot.

I also read doing something like:

softwareupdate -i -a && reboot 

Should work... But my test systems just reboot and don't install updates this way.  Only with the "-R"

Was just curious if anyone else had seen this or had a workaround.

 

 

 

 

1 REPLY 1

AJPinto
Contributor III

Its working as intended. If the updates require a reboot you have to use the -R flag to install them. If you reboot "externally" the updates will not install. Its how apple handles the protected boot volume, blah blah blah. If something suppresses a reboot the -R cannot reboot the mac to install the updates, and since the Mac is not being rebooted with -R updates dont install. The softwareupdate binary is very poorly designed, honestly as are most macOS functions related to managing software updates.

 

softwareupdate -aiR will not work on Apple Silicon without User approval. You probably should start looking in to the Schedule an Update Management Command which is the direction Apple is going. However, it is just as bad if not worse than softwareupdate. 😕