Scoop 是一个面向 Windows 的命令行安装程序(包管理器),旨在简化在 Windows 系统上安装、更新和管理开源命令行工具和应用程序的过程。
主要特点包括:
- 无需管理员权限 :默认将软件安装到用户目录(如
~\scoop),避免系统污染。 - 使用简单 :通过简洁的命令(如
scoop install <app>)即可完成软件的安装。 - 基于 Git 和 JSON 清单:软件定义以 JSON 格式存储在称为"bucket"的仓库中,便于维护和扩展。
- 支持多 bucket :除了官方主仓库(main bucket),还支持额外的社区或私有 bucket(如
extras、versions等)。 - 自动处理 PATH 和依赖:安装后自动配置环境变量,部分软件会自动安装所需依赖(如 Visual C++ Redistributables)。
查找 scoop 可下载的 Apps,可以从 https://scoop.sh/#/apps 寻找
安装下载步骤
打开powershell,依次输入下面的命令
powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
配置国内镜像源
一般 scoop 默认配置的源下载比较缓慢,我们使用国内的镜像源。
先删除默认 main 源
powershell
scoop bucket rm main
添加南大镜像
powershell
scoop bucket add main https://mirror.nju.edu.cn/git/scoop-main.git
scoop bucket add extras https://mirror.nju.edu.cn/git/scoop-extras.git
恢复回官方源
想要从国内源恢复至官方源
powershell
scoop bucket rm main
scoop bucket rm extras
scoop bucket add main
scoop bucket add extras
config配置
查看配置
powershell
scoop config
建议开启缓存,避免重复下载
powershell
scoop config cache_enabled true
常用命令
powershell
scoop install git nodejs python
scoop search jdk
scoop update *
scoop list
scoop reset python39 # 切换默认 Python 版本