三大包管理器对比
| 工具 | 适用人群 | 包数量 | 优势 | 劣势 |
|---|
| Scoop | 开发者 | ~5000+ | 绿色软件、解压即用、卸载无残留 | GUI 工具不收录、需要手动加 bucket |
| Winget | 普通用户 | ~4000+ | 微软官方、Windows 10/11/Server 自带 | GUI 体验差、包版本旧 |
| Chocolatey | 复杂工具链 | ~9000+ | 包最全、CI/CD 集成好 | 全局安装需管理员 |
Why 三者并存:Scoop 适合开发工具(git / node / ffmpeg),Winget 适合日常应用(Office / Chrome),Chocolatey 适合企业部署。
一、Scoop:开发者的绿色工具
安装
1
2
3
4
5
6
| # 普通用户
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
# 管理员
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
|
改目录(推荐)
1
2
3
4
5
6
7
8
9
10
11
| # 用户级目录
$env:SCOOP='D:\portable\scoop\user'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# 全局目录(需管理员)
$env:SCOOP_GLOBAL='D:\portable\scoop\global'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
# 全局安装 -g
scoop install sudo
scoop install -g <pkg>
|
Scoop 目录结构
1
2
3
4
5
6
| D:\portable\scoop\
├── apps\ # 所有通过 scoop 安装的软件
├── buckets\ # 软件源仓库
├── cache\ # 下载缓存
├── persist\ # 用户数据(更新不覆盖)
└── shims\ # 软链接
|
GUI 程序自动在开始菜单创建快捷方式:C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps
常用命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| scoop search xxx # 搜索
scoop install AppName # 安装
scoop install git@2.23.0.windows.1 # 特定版本
scoop uninstall AppName
scoop update # 更新 Scoop 自身
scoop update * # 更新所有
scoop hold <app> # 锁定阻止更新
scoop unhold <app> # 取消锁定
scoop info <app> # 包元数据
scoop home <app> # 打开官网
# 缓存
scoop cache show
scoop cache rm <app>
scoop cache rm *
# 旧版本清理
scoop cleanup <app>
scoop cleanup <app> -g # 全局版
scoop cleanup <app> -k # 保留缓存
|
仓库(bucket)
Scoop 默认只有 main bucket(CLI 工具),GUI 工具要加 extras 等:
1
2
3
4
5
6
7
8
9
| scoop bucket known # 看已知 bucket
scoop bucket add extras
scoop bucket add nirsoft
scoop bucket add games
scoop bucket add dorado https://github.com/chawyehsu/dorado
scoop bucket add Ash258 'https://github.com/Ash258/Scoop-Ash258.git'
scoop bucket add nerd-fonts
scoop bucket add java
scoop bucket add versions
|
bucket 名称冲突:scoop install dorado/appname 用 <bucket>/<app> 格式指定。
二、Winget:微软官方
安装
Winget 已在 Windows 10 1809+ / Windows 11 / Windows Server 2025 自带。手动装:
- Microsoft Store 搜 “应用安装程序”
- 或者 GitHub Release 手动下载 .msi
常用命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| winget -v
winget --help
# 搜索
winget search --id Microsoft.PowerShell
# 安装
winget install --id Microsoft.PowerShell
winget install --id Microsoft.PowerShell --source winget
# 指定安装位置
winget install <App> --location "D:\Program Files"
# 更新
winget upgrade # 看可更新列表
winget upgrade --all # 全部更新
winget upgrade "App" --uninstall-previous # 更新前卸载老版
|
三、Chocolatey:企业级
1
2
3
4
5
6
7
8
9
10
11
12
| # 安装(PowerShell 管理员)
irm https://community.chocolatey.org/install.ps1 | iex
# 验证
choco -v
# 自我更新
choco upgrade chocolatey
# 自定义安装路径
New-Item -ItemType Directory -Path "D:\soft\choco"
[Environment]::SetEnvironmentVariable('ChocolateyInstall', 'D:\soft\choco', 'Machine')
|
四、批量安装脚本
下面是 2024 年日常开发工作站的标配安装清单:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| # === Scoop 用户级 ===
scoop install git
scoop install nodejs
scoop install python
scoop install go
scoop install rust
scoop install neovim
scoop install fzf fd ripgrep jq
scoop install lazygit
scoop install gh
scoop install aria2 # scoop 下载加速
scoop install 7zip
scoop install extras/umi-ocr-paddle # 离线 OCR
# === Scoop 全局 ===
scoop install -g sudo
# === Bucket 加好后 ===
scoop bucket add extras
scoop bucket add nerd-fonts
scoop install nerd-fonts/JetBrainsMono
scoop install nerd-fonts/Meslo
# === Winget ===
winget install --id Google.Chrome
winget install --id Microsoft.VisualStudioCode
winget install --id JanDeDobbeleer.OhMyPosh -s winget
winget install --id 7zip.7zip
|
五、卸载与切换
1
2
3
4
5
6
7
8
9
| # 卸载 Scoop
scoop uninstall scoop
# 卸载 Winget
winget uninstall --id Microsoft.DesktopAppInstaller
# 卸载 Chocolatey
Remove-Item -Recurse -Force "$env:ChocolateyInstall"
[Environment]::SetEnvironmentVariable('ChocolateyInstall', $null, 'Machine')
|
下一步
- 想用 Oh My Posh 给 PowerShell 加 Powerlevel10k 同款主题,看 2017-11-15《Windows 终端与 Shell 工具链》
- 想把 WSL2 当主力开发环境,看 2017-01-15《WSL2 完整使用手册》
参考资料
- Scoop 官方:https://scoop.sh/
- Scoop buckets 列表:https://github.com/rasa/scoop-directory
- Winget 官方仓库:https://github.com/microsoft/winget-cli
- Chocolatey 官方:https://chocolatey.org