grahampugh / erase-install

A script that automates downloading macOS installers, and optionally erasing or upgrading macOS in a single process. Watch the video!
https://grahamrpugh.com/2023/05/14/macaduk-presentation-eraseinstall.html
Apache License 2.0
845 stars 132 forks source link

softwareupdate: unrecognized option `--list-full-installers' #282

Closed reuven-cohen closed 2 years ago

reuven-cohen commented 2 years ago

Describe the bug The EraseInstall script we've been running with is no longer working and spits out an error that makes me wonder if something changed with SoftwareUpdate.

To Reproduce

Expected behavior Previously the DepNotify window would appear, show download progress then proceed with macOS Monterey Upgrade.

Code/log output

[erase-install] v26.1 script execution started: Wed Aug 24 16:45:06 EDT 2022
   [erase-install] Caffeinating this script (pid=2212)
   [check_free_space] OK - 97 GB free/purgeable disk space detected
   [check_power_status] OK - AC power detected
   [erase-install] Looking for existing installer app or pkg
   [find_existing_installer] Installer found at /Applications/Install macOS Monterey.app.
   [check_installer_is_valid] Checking validity of /Applications/Install macOS Monterey.app.
   [check_installer_is_valid] Mounting /Applications/Install macOS Monterey.app/Contents/SharedSupport/SharedSupport.dmg
   [check_installer_is_valid] Using Build value from com_apple_MobileAsset_MacSoftwareUpdate.xml
Volume Shared Support on disk2s2 force-unmounted
   [compare_build_versions] Comparing (1) 19H2026 with (2) 21G72
   [check_installer_is_valid] Installer: 21G72 >= System: 19H2026 : valid build.
   [erase-install] Existing installer does not match requested version, so replacing...
   [overwrite_existing_installer] Overwrite option selected. Deleting existing version.
   [erase-install] Running on architecture i386
   [erase-install] Opening DEPNotify download message (language=en)
   [erase-install] OS version is 10.15 so can run with --fetch-full-installer option
   [set_seedprogram] Standard seed program selected
   [set_seedprogram] Currently enrolled in (null) seed program.

softwareupdate: unrecognized option `--list-full-installers'
usage: softwareupdate <cmd> [<args> ...]

** Manage Updates:
    -l | --list     List all appropriate update labels (options:  --no-scan, --product-types)
    -d | --download     Download Only
    -e | --cancel-download      Cancel a download
    -i | --install      Install
        <label> ... specific updates
        -a | --all      All appropriate updates
        -R | --restart      Automatically restart (or shut down) if required to complete installation.
        -r | --recommended  Only recommended updates
    --fetch-full-installer      Install the latest macOS Installer
        --full-installer-version    The version of macOS to install. Ex: --full-installer-version 10.15
    --background        Trigger a background scan and update operation
    --ignore <label> ...    Ignore specific updates
    --reset-ignored     Clear all ignored updates

** Other Tools:
    --dump-state        Log the internal state of the SU daemon to /var/log/install.log
    --evaluate-products Evaluate a list of product keys specified by the --products option 
    --history       Show the install history.  By default, only displays updates installed by softwareupdate.  
    --all           Include all processes in history (including App installs) 

** Options:
    --no-scan       Do not scan when listing or installing updates (use available updates previously scanned)
    --product-types <type>      Limit a scan to a particular product type only - ignoring all others
        Ex:  --product-types macOS  || --product-types macOS,Safari 
    --products      A comma-separated (no spaces) list of product keys to operate on. 
    --force         Force an operation to complete.  Use with --background to trigger a background scan regardless of "Automatically check" pref 

    --verbose       Enable verbose output
    --help          Print this help

softwareupdate: unrecognized option `--list-full-installers'
usage: softwareupdate <cmd> [<args> ...]

** Manage Updates:
    -l | --list     List all appropriate update labels (options:  --no-scan, --product-types)
    -d | --download     Download Only
    -e | --cancel-download      Cancel a download
    -i | --install      Install
        <label> ... specific updates
        -a | --all      All appropriate updates
        -R | --restart      Automatically restart (or shut down) if required to complete installation.
        -r | --recommended  Only recommended updates
    --fetch-full-installer      Install the latest macOS Installer
        --full-installer-version    The version of macOS to install. Ex: --full-installer-version 10.15
    --background        Trigger a background scan and update operation
    --ignore <label> ...    Ignore specific updates
    --reset-ignored     Clear all ignored updates

** Other Tools:
    --dump-state        Log the internal state of the SU daemon to /var/log/install.log
    --evaluate-products Evaluate a list of product keys specified by the --products option 
    --history       Show the install history.  By default, only displays updates installed by softwareupdate.  
    --all           Include all processes in history (including App installs) 

** Options:
    --no-scan       Do not scan when listing or installing updates (use available updates previously scanned)
    --product-types <type>      Limit a scan to a particular product type only - ignoring all others
        Ex:  --product-types macOS  || --product-types macOS,Safari 
    --products      A comma-separated (no spaces) list of product keys to operate on. 
    --force         Force an operation to complete.  Use with --background to trigger a background scan regardless of "Automatically check" pref 

    --verbose       Enable verbose output
    --help          Print this help

softwareupdate: unrecognized option `--list-full-installers'
usage: softwareupdate <cmd> [<args> ...]

** Manage Updates:
    -l | --list     List all appropriate update labels (options:  --no-scan, --product-types)
    -d | --download     Download Only
    -e | --cancel-download      Cancel a download
    -i | --install      Install
        <label> ... specific updates
        -a | --all      All appropriate updates
        -R | --restart      Automatically restart (or shut down) if required to complete installation.
        -r | --recommended  Only recommended updates
    --fetch-full-installer      Install the latest macOS Installer
        --full-installer-version    The version of macOS to install. Ex: --full-installer-version 10.15
    --background        Trigger a background scan and update operation
    --ignore <label> ...    Ignore specific updates
    --reset-ignored     Clear all ignored updates

** Other Tools:
    --dump-state        Log the internal state of the SU daemon to /var/log/install.log
    --evaluate-products Evaluate a list of product keys specified by the --products option 
    --history       Show the install history.  By default, only displays updates installed by softwareupdate.  
    --all           Include all processes in history (including App installs) 

** Options:
    --no-scan       Do not scan when listing or installing updates (use available updates previously scanned)
    --product-types <type>      Limit a scan to a particular product type only - ignoring all others
        Ex:  --product-types macOS  || --product-types macOS,Safari 
    --products      A comma-separated (no spaces) list of product keys to operate on. 
    --force         Force an operation to complete.  Use with --background to trigger a background scan regardless of "Automatically check" pref 

    --verbose       Enable verbose output
    --help          Print this help

   [swu_list_full_installers] Could not obtain installer information using softwareupdate. Cannot continue.

   [erase-install] attempting to terminate the 'caffeinate' process - Termination message indicates success
/Library/Management/erase-install/erase-install.sh: line 1078:  2231 Terminated: 15          /usr/bin/caffeinate -dimsu -w $$

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

grahampugh commented 2 years ago

Seems like it must be a bug with the latest version of 10.15.7, if --list-full-installers isn't being recognised. Unfortunately there's nothing I can do to make the script work under those circumstances. I suggest you use the default method or --pkg method, rather than the --fetch-full-installer method, and open a case with Apple to get it fixed (sadly that's unlikely to get resolved at this late stage in the Catalina cycle).

reuven-cohen commented 2 years ago

Thanks for the quick response. I'll try seeing if I can get the default or --pkg method working in our environment.

grahampugh commented 2 years ago

OK so I now figured out that --list-full-installers is not a known flag on macOS Catalina. It was introduced in Big Sur. This unfortunately means that you can't use that option on Catalina. Since Catalina is now deprecated, it's not something I intend to try and workaround. I would suggest the default or --pkg options instead.

grahampugh commented 2 years ago

(that said, you may be able to use v. 25 or older of erase-install on those old machines, because that still used installinstallmacos.py to grab the list of installers)