649 字
3 分钟
Windows使用Scoop包管理器
Windows系统使用Scoop包管理器教程
Scoop 包管理器优势
- 无需管理员权限:安装在用户目录,干净无系统污染。
- 绿色便携:软件以解压包形式安装,卸载即删目录。
- 多版本管理:支持同一软件多版本安装与切换。
- Git + JSON驱动:包描述开源,灵活可扩展。
- 开发友好:一键自动安装,自动配置环境变量,多版本管理等等。
- 优秀的开发环境支持:一键安装Node.js、Python、Go等等多种开发工具。
- 软件众多:支持各种软件包,开发环境,以及常用的Gui软件。
步骤 1:启用 PowerShell 执行策略
在安装 Scoop 之前,您需要允许 PowerShell 执行脚本。
- PowerShell 执行以下命令:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
当提示时,输入 A
并按回车键确认。
步骤 2:安装 Scoop
先安装Git工具,Scoop依赖Git工具的支持,安装完成后就可以安装 Scoop 了
- 在当前 PowerShell 窗口中,执行以下命令:
irm get.scoop.sh | iex
这将下载并执行 Scoop 的安装脚本。
- 验证安装成功
scoop help
步骤 3:bucket
为了能够安装更多软件,您可以添加一些常用的 bucket。
Scoop 官方常用 Bucket 介绍
也就是Github仓库上的软件清单列表
main
地址:https://github.com/ScoopInstaller/Main
说明:官方主仓库,常用软件和基础工具,默认存在,无需配置。extras
地址:https://github.com/ScoopInstaller/Extras
说明:较多 GUI 软件、实用工具versions
地址:https://github.com/ScoopInstaller/Versions
说明:多版本软件(Node.js、Python、JDK 等)
更多包搜索:https://scoop.sh/
添加更多Bucket
先删除默认源,也就是Bucket
scoop bucket rm main
main
代表源的名称,此源是默认就有的源。
scoop的源也叫bucket仓库
,托管在Github,所以需要添加Github加速:
scoop bucket add main https://gh-proxy.com/https://github.com/ScoopInstaller/Main.git
scoop bucket add versions https://gh-proxy.com/https://github.com/ScoopInstaller/Versions.git
scoop bucket add extras https://gh-proxy.com/https://github.com/ScoopInstaller/Extras.git
查看所有bucket仓库
scoop bucket list
安装的软件存放目录
C:\Users\<你的用户名>\scoop\
常用命令示例
- 搜索软件:
scoop search 软件名
- 安装软件:
scoop install 软件名
- 更新软件:
scoop update 软件名
- 更新所有软件:
scoop update *
- 卸载软件:
scoop uninstall 软件名
- 查看安装缓存:
scoop cache
- 清理所有缓存:
scoop cache rm *
- 安装多个版本(示例)
scoop install nodejs # 最新稳定版
scoop install nodejs20 # 20.x 版本
scoop install nodejs18 # 18.x 版本
- 查看已安装版本
scoop list nodejs*
- 使用 scoop reset 切换版本
scoop reset nodejs18
这条命令会把 node 命令指向 nodejs18 版本。
- 验证当前版本
node -v
- 安装完成后记得清理下载的缓存
`scoop cache rm *`