MacOS Update from Terminal

foreverkan
New Contributor III

Hello, I would like to update some devices from Jamf. I create a script but it doesnt work. Where is the problem?

The script is,

#!/bin/bash

sudo softwareupdate -i macOS\ Monterey\ 12.6.3-21G419 -R

exit 0

Thank you.

12 REPLIES 12

Bol
Valued Contributor

https://learn.jamf.com/bundle/technical-paper-deploying-macos-upgrades-current/page/Running_Software...

Alternatively, a policy could call the softwareupdate framework directly, bypassing Jamf Pro's restart options in the policy. This can be achieved in a Files and Processes payload, running the command softwareupdate -iaR as a local command. When running updates this way, macOS restarts the computer automatically if needed for the update to complete.



jtrant
Valued Contributor

This isn't going to work on Apple Silicon Macs, if that's what you're trying to do.

foreverkan
New Contributor III

Apple silicon and intel cpu macs. I'm very lost.

mhasman
Valued Contributor

Hopefully, we will see new better system software management with Sonoma, soon

howie_isaacks
Valued Contributor II

At a past job I used Nudge for prompting users to run the macOS software updates. I'm in the middle of getting that setup and tested at my new job. Because of the volume owner feature of macOS on Apple Silicon Macs, it's a lot more difficult to create software updates policies without user involvement. That's why Nudge works so well. It guides the user to do the update, and we can allow standard users to install the updates. I have been able to do that using Nudge on both Apple Silicon and Intel Macs.

https://github.com/macadmins/nudge/wiki 

Bol
Valued Contributor

@foreverkan wrote:

Hello, I would like to update some devices from Jamf. I create a script but it doesnt work. Where is the problem?

The script is,

#!/bin/bash

sudo softwareupdate -i macOS\ Monterey\ 12.6.3-21G419 -R

exit 0

Thank you.


I believe this is the command you were trying to run but corrected;


sudo -S softwareupdate -iR "macOS Monterey 12.6.3-21G419" --stdinpass "loggedInUserPassword" --user "LogedInUserName"

 

foreverkan
New Contributor III

Here is the last situation;

I created a policy like this, 

Screenshot 2023-07-11 at 16.02.52.png

Its downloading last major update from apple and install it.

In Intel cpu's user can restart mac and update finish succesfly. 

But in Silicon cpu's user cannot restart mac to finish update. Because when they click to restart now button mac asks user credentianls. Mac doesnt accecpt logged user(standard user) credentianls. When i try to enter local admin username and password it says this.

1111.png

Bol
Valued Contributor

You need to authenticate with credentials of a volume owner, either standard user or admin.

If there isn't one, there needs to be a bootstrap token escrowed to Jamf which can then allow the restart to complete the install.

mhasman
Valued Contributor

To update Macs with Apple CPU, send MDM command. In the list of Macs, click "Action"

 

 

Screenshot 2023-07-11 at 09.05.51.png

 

Screenshot 2023-07-11 at 09.07.03.png

 

Screenshot 2023-07-11 at 09.07.39.png

 

foreverkan
New Contributor III

Thank you for your quick reply. Here is the second question, we dont use mdm profile. İs there any option?

if your Mac's are enrolled correctly they should have an MDM profile on them, if not that you are not enrolling correctly. 

foreverkan
New Contributor III

here is the final, I write a policy to install update from apple.

It's downloading os from and it's installing and the final system settings ask admin credentinals. 

not: Encptryp is enabled and users are not admin on macbooks.

policypolicyPolicyPolicyScreenshot 2023-08-03 at 13.42.57.png