Skip to content

refactor: use sudo softwareupdate --install --all --restart to update macOS#627

Open
SteveLauC wants to merge 3 commits into
topgrade-rs:mainfrom
SteveLauC:macos_system_update
Open

refactor: use sudo softwareupdate --install --all --restart to update macOS#627
SteveLauC wants to merge 3 commits into
topgrade-rs:mainfrom
SteveLauC:macos_system_update

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

use sudo softwareupdate --install --all --restart to update macOS

for more info, see the discussion in #546

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

@SteveLauC
Copy link
Copy Markdown
Member Author

cc @DucretJe @reini-1, I don't have a macOS machine at hand so I cannot give you guys a binary to test, I am sorry.

@schrobingus
Copy link
Copy Markdown
Contributor

I can test :^)

@SteveLauC
Copy link
Copy Markdown
Member Author

I can test :^)

Thanks for your interest in helping with this issue, but it is indeed not that easy to solve this issue, see this comment

@pan93412
Copy link
Copy Markdown
Member

pan93412 commented Apr 1, 2024

I'd rather not restart here as there might be some cleanup needed before letting softwareupdate restart this device. However, the original command seems to restart even without the --restart flag. Can someone assist in testing these commands? :)

barkleesanders added a commit to barkleesanders/topgrade that referenced this pull request Mar 8, 2026
Run `softwareupdate` through sudo and add the `--restart` flag so
that the system can reboot automatically when a macOS update requires
it. This aligns with the behavior described in the softwareupdate(8)
man page.

Based-on-PR: topgrade-rs#627
Original-author: Steve Lau <stevelauc@outlook.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants