Skip to main content
Question

does the software update command have --forcequitapps?


Forum|alt.badge.img+20

the macOS installers have the --forcequitapps argument, can this also be used for the softwareupdate command?

'/Applications/Install macOS Catalina.app/Contents/Resources/startosinstall' --agreetolicense --forcequitapps

so if I have the 'execute command' softwareupdate -aiR --forcquitapps 

will this work for the software update command?

 

I'm testing a self service policy, with notification popup  for computers that have macOS updates pending, so during my first test on a system that needed 11.6.1 and a Safari update installed,  the computer did not restart since SELF SERVICE was open, once I quit Self Service the computer restarted and the updates installed.

So if there are multiple applications open then then obviously the  restart would still not occur, so would this --forcequitapps work at the end of the softwareupdate -aiR command?

4 replies

Hugonaut
Forum|alt.badge.img+15
  • Esteemed Contributor
  • 574 replies
  • November 8, 2021

@tcandelaNo, the --forcequitapps flag is explicitly for the startosinstall binary. you can run "man softwareupdate" in terminal to see all the flags. Pasted below is the man page from macOS Big Sur 11

What you are looking for is

 

-R | --restart Automatically restart (or shut down) if required to complete installation. If the user invoking this tool is logged in then macOS will attempt to quit all applications, logout, and restart. If the user is not logged in, macOS will trigger a forced reboot if necessary. If you wish to always perform a forced reboot, pass -f (--force).

 

 

Hugonaut:~ Hugo$ man softwareupdate Each update specified by args is downloaded and installed. args can be one of the fol- lowing: -r | --recommended All updates that are recommended for your system. These are prefixed with a * character in the --list output. -R | --restart Automatically restart (or shut down) if required to complete installation. If the user invoking this tool is logged in then macOS will attempt to quit all applications, logout, and restart. If the user is not logged in, macOS will trigger a forced reboot if necessary. If you wish to always perform a forced reboot, pass -f (--force). -a | --all All updates that are applicable to your system, including those non-recom- mended ones, which are prefixed with a - character in the --list output. (Non-recommended updates are uncommon in any case.) item ... One or more specified updates. The --list output shows the item names you can specify here, prefixed by the * or - characters. See EXAMPLES. -d | --download Each update specified by args is downloaded but not installed. The values of args are the same as for the --install command. Updates downloaded with --download can be subse- quently installed with --install, or through the App Store (as long as they remain applicable to your system). Updates are downloaded to /Library/Updates, but are not designed to be installed by double-clicking the packages in that directory: always use --install or the App Store to actually perform the install. --schedule Returns the per-machine automatic (background) check preference. -h | --help Print command usage. EXAMPLES The following examples are shown as given to the shell: softwareupdate --list Software Update Tool Finding available software Software Update found the following new or updated software: * Label: MacBookAirEFIUpdate2.4-2.4 Title: MacBook Air EFI Firmware Update, Version: 2.4, Size: 3817K, Recommended: YES, Action: restart, * Label: ProAppsQTCodecs-1.0 Title: ProApps QuickTime codecs, Version: 1.0, Size: 968K, Recommended: YES, * Label: JavaForOSX-1.0 Title: Java for OS X 2012-005, Version: 1.0, Size: 65288K, Recommended: YES, sudo softwareupdate --install JavaForOSX-1.0 Software Update Tool Finding available software Downloading Java for OS X 2012-005 Downloaded Java for OS X 2012-005 Installing Java for OS X 2012-005 Done with Java for OS X 2012-005 Done. sudo softwareupdate --schedule

 

 


IamGroot
Forum|alt.badge.img+2
  • New Contributor
  • 23 replies
  • November 9, 2021

You can run the below command which should do just that.

 

 

softwareupdate -iaR

 


Forum|alt.badge.img+20
  • Author
  • Contributor
  • 983 replies
  • November 9, 2021

@Hugonaut  @IamGroot   the command i currently use is  softwareupdate -aiR

 

does it matter if the 'a' and 'i' are in different order?  the help menu shows the 'i'  as an option, while the 'a' is an argument.   I do have the R in my command but it didn't restart because it of 'Self Service' being open.

I added to the policy the 'Restart' payload an set it to 'restart immediately' for both 'no user logged in' and 'user logged in'  and retested it with not just Self Service open but also Microsoft Word and the computer restarted.

I'm going to test the -v to see if it will show the progress of the download/installation of the updates.

so

softwareupdate -ivaR


Hugonaut
Forum|alt.badge.img+15
  • Esteemed Contributor
  • 574 replies
  • November 9, 2021
tcandela wrote:

@Hugonaut  @IamGroot   the command i currently use is  softwareupdate -aiR

 

does it matter if the 'a' and 'i' are in different order?  the help menu shows the 'i'  as an option, while the 'a' is an argument.   I do have the R in my command but it didn't restart because it of 'Self Service' being open.

I added to the policy the 'Restart' payload an set it to 'restart immediately' for both 'no user logged in' and 'user logged in'  and retested it with not just Self Service open but also Microsoft Word and the computer restarted.

I'm going to test the -v to see if it will show the progress of the download/installation of the updates.

so

softwareupdate -ivaR


@tcandela

 

softwareupdate -ivaRf

If you wish to always perform a forced reboot, pass -f (--force).

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings