用 softwareupdate 命令检查并安装 macOS 更新
使用 macOS 内置的 softwareupdate 命令行工具,无需打开系统设置即可列出、下载并安装苹果软件更新。
运行 `softwareupdate -l` 列出可用更新,用 `sudo softwareupdate -i -a` 安装全部更新。
01命令
命令
$ softwareupdate -l -i -a --list-full-installer-versions02作用说明
softwareupdate 直接对接苹果的软件更新服务,是通过 SSH 远程给 Mac 打补丁或在脚本中自动化更新的标准方式。`softwareupdate -l` 会列出每个待更新项及其标识符,可传给 `-i <名称>` 做选择性安装。加 `--restart` 可让系统在关键补丁装完后自动重启,`--list-full-installers` 则能查看所有可下载的完整 macOS 安装器版本。
03风险
!注意: 安装需要重启的更新时会中断 SSH 会话,请提前安排好时间。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- SoftwareUpdate Command: How to update software in macOS依据: Documents softwareupdate -l to list, -i -a to install all available updates, and related flags.
- Update macOS on Mac - Apple Support依据: Apple's guide to updating macOS; the Software Update mechanism behind the CLI is documented here.
最后验证: 2026-09-17 · 分类: 系统与设置