macOS Command - softwareupdate
文章目錄
- 一、關(guān)于 softwareupdate
- 相關(guān)GUI
- 相關(guān)配置文件
- 二、使用示例
- 查看更新
- 應(yīng)用建議的更新(recommended updates)
- 安裝系統(tǒng)所有的更新
- 忽略某個更新
- 重置忽略的更新
- 關(guān)閉/開啟 后臺自動更新的檢查
- 查看下載安裝進(jìn)度
- 查看更多選項
- 下載但不安裝
- 取消下載
- 三、manual
- NAME
- SYNOPSIS
- DESCRIPTION
- EXAMPLES
- 相關(guān)資料
本文基于 macOS 11.2
一、關(guān)于 softwareupdate
softwareupdate : system software update tool,系統(tǒng)軟件更新工具
相關(guān)GUI
系統(tǒng)偏好設(shè)置 – 軟件更新
- 《macOS 使用手冊》:在 Mac 上更改“軟件更新”偏好設(shè)置
https://support.apple.com/zh-cn/guide/mac-help/mchla7037245/mac
相關(guān)配置文件
/Library/Preferences/com.apple.SoftwareUpdate.plist
這里記錄著 softwareupdate 相關(guān)配置數(shù)據(jù)
$ plutil -p /Library/Preferences/com.apple.SoftwareUpdate.plist {"AutomaticallyInstallMacOSUpdates" => 0 # 自動安裝 macOS 更新"AutomaticCheckEnabled" => 0 # 是否開啟 自動檢測 "AutomaticDownload" => 0 # 自動下載"ConfigDataInstall" => 0 "CriticalUpdateInstall" => 0"InactiveUpdates" => []"LastAttemptBuildVersion" => "11.2 (20D64)""LastAttemptSystemVersion" => "11.2 (20D64)""LastBackgroundSuccessfulDate" => 2020-09-24 11:35:54 +0000"LastFullSuccessfulDate" => 2021-03-09 10:36:43 +0000"LastRecommendedMajorOSBundleIdentifier" => """LastRecommendedUpdatesAvailable" => 0"LastResultCode" => 2"LastSessionSuccessful" => 1"LastSuccessfulDate" => 2021-03-09 10:36:47 +0000"LastUpdatesAvailable" => 0"PrimaryLanguages" => [0 => "zh-Hans-CN"1 => "zh-Hans"2 => "fr-CN"3 => "en-GB"]"RecommendedUpdates" => [ # 建議安裝的更新]"SkipLocalCDN" => 0 }你也可以使用 defaults 命令來修改配置
defaults 使用方法可參考:https://blog.csdn.net/lovechris00/article/details/113280758
二、使用示例
以下示例大部分來自 How To Update Apple OS X Using Command Line Software Update Tool
查看更新
$ softwareupdate -l Software Update ToolFinding available software No new software available.除了查看命令,其他命令均需要管理員權(quán)限
應(yīng)用建議的更新(recommended updates)
所有建議的更新
$ sudo softwareupdate -r安裝系統(tǒng)所有的更新
$ sudo softwareupdate -i -a$ softwareupdate --all --install --force # 強(qiáng)制安裝所有 Software Update ToolFinding available software Attempting to quit apps: ("com.apple.Compressor" ) Successfully quit all appsDownloading 專業(yè)視頻格式 Downloaded 專業(yè)視頻格式 Installing 專業(yè)視頻格式 Done with 專業(yè)視頻格式 Done.
忽略某個更新
比如忽略 JavaForOSX 更新
$ sudo softwareupdate --ignore JavaForOSX重置忽略的更新
$ sudo softwareupdate --reset-ignored關(guān)閉/開啟 后臺自動更新的檢查
開啟
$ sudo softwareupdate --schedule on關(guān)閉
$ sudo softwareupdate --schedule off查看下載安裝進(jìn)度
$ sudo softwareupdate -vi RAWCameraUpdate6.17-6.17或者
sudo softwareupdate -v -i iTunesXPatch-12.3.1查看更多選項
$ man softwareupdatesoftwareupdate -h下載但不安裝
$ sudo softwareupdate -d nameHere $ sudo softwareupdate -d iTunesXPatch-12.3.1取消下載
$ sudo softwareupdate -e三、manual
softwareupdate(8) BSD System Manager’s Manual softwareupdate(8)
NAME
softwareupdate – system software update tool
SYNOPSIS
softwareupdate command [args …]
DESCRIPTION
Software Update checks for new and updated versions of your software based on information about your computer and current software.
Invoke softwareupdate by specifying a command followed by zero or more args.
softwareupdate requires admin authentication for all commands except –list.
? If you run softwareupdate as a normal admin user, you will be prompted for a password where required.
? Alternatively, you can run softwareupdate as root and avoid all further authentication prompts.
The following commands are available:
-l | –list
? List all available updates.
-i | –install
? Each update specified by args is downloaded and installed. args can be one of the following:
-
-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-recommended 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 subsequently 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
? Automatic check is on
Mac OS September 11, 2012 Mac OS
相關(guān)資料
-
How to apply OS X software updates from the command line
https://www.cnet.com/news/how-to-apply-os-x-software-updates-from-the-command-line/ -
How To Update Apple OS X Using Command Line Software Update Tool
https://www.cyberciti.biz/faq/apple-mac-os-x-update-softwareupdate-bash-shell-command/
伊織 2021-03-09
總結(jié)
以上是生活随笔為你收集整理的macOS Command - softwareupdate的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 百度没有柳传志,联想没有李彦宏
- 下一篇: 文字溢出显示点点点