日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

macOS Command - softwareupdate

發布時間:2023/12/16 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 macOS Command - softwareupdate 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

文章目錄

    • 一、關于 softwareupdate
      • 相關GUI
      • 相關配置文件
    • 二、使用示例
      • 查看更新
      • 應用建議的更新(recommended updates)
      • 安裝系統所有的更新
      • 忽略某個更新
      • 重置忽略的更新
      • 關閉/開啟 后臺自動更新的檢查
      • 查看下載安裝進度
      • 查看更多選項
      • 下載但不安裝
      • 取消下載
    • 三、manual
      • NAME
      • SYNOPSIS
      • DESCRIPTION
      • EXAMPLES
    • 相關資料


本文基于 macOS 11.2

一、關于 softwareupdate

softwareupdate : system software update tool,系統軟件更新工具


相關GUI

系統偏好設置 – 軟件更新



  • 《macOS 使用手冊》:在 Mac 上更改“軟件更新”偏好設置
    https://support.apple.com/zh-cn/guide/mac-help/mchla7037245/mac

相關配置文件

/Library/Preferences/com.apple.SoftwareUpdate.plist

這里記錄著 softwareupdate 相關配置數據

$ 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.

除了查看命令,其他命令均需要管理員權限


應用建議的更新(recommended updates)

所有建議的更新

$ sudo softwareupdate -r

安裝系統所有的更新

$ sudo softwareupdate -i -a
$ softwareupdate --all --install --force # 強制安裝所有 Software Update ToolFinding available software Attempting to quit apps: ("com.apple.Compressor" ) Successfully quit all appsDownloading 專業視頻格式 Downloaded 專業視頻格式 Installing 專業視頻格式 Done with 專業視頻格式 Done.

忽略某個更新

比如忽略 JavaForOSX 更新

$ sudo softwareupdate --ignore JavaForOSX

重置忽略的更新

$ sudo softwareupdate --reset-ignored

關閉/開啟 后臺自動更新的檢查

開啟

$ sudo softwareupdate --schedule on

關閉

$ sudo softwareupdate --schedule off

查看下載安裝進度

$ 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


相關資料

  • 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

總結

以上是生活随笔為你收集整理的macOS Command - softwareupdate的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。