Chocolatey是一款專為Windows系統開發的、基於NuGet的包管理器工具,類似於Node.js的npm,MacOS的 brew,Ubuntu的 apt-get,簡稱為 choco。
Chocolatey的設計目標是成為一個去中心化的框架,便於開發者按需快速安裝應用程序和工具。
Chocolatey 官網: https://chocolatey.org/
安裝:
1. cmd下執行
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
2. PowerShell下執行
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
使用:
安裝成功之后, 在終端執行命令choco
顯示版本信息, 說明已經安裝成功
包列表:
官網提供了很多可用的軟件包:https://chocolatey.org/packages
基本使用:
- search - 搜索包
choco search something
- list - 列出包
choco list -lo
- install - 安裝
choco install baretail
- pin - 固定包的版本,防止包被升級
choco pin windirstat
- upgrade - 安裝包的升級
choco upgrade baretail
- uninstall - 安裝包的卸載
choco uninstall baretail
安裝Ruby
choco install ruby
更新功能通過 choco -help 查看
