Scoop-window平台包管理工具

目录
显示
简介
这是一款window环境下的通过命令行进行软件管理的工具, 可以对同一app的多版本进行管理切换。比如安装java,不需要自己去设置环境变量,切换不通版本也是一个命令解决。
官网 https://scoop.sh
GitHub: https://github.com/ScoopInstaller/Scoop
安装
- 设置允许 PowerShell 执行本地脚本
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
[Net.ServicePointManager]::SecurityProtocol
- 自定义 Scoop 安装目录
$env:SCOOP='D:\\scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
$env:SCOOP_GLOBAL='D:\\scoop'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
- 安装
irm get.scoop.sh | iex
# 如果以上命令安装报错无法以administrator运行, 就用下面的2个命令安装
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\\install.ps1 -RunAsAdmin
# 默认是从github下载,如果访问,可以切换国内的源
scoop config SCOOP_REPO <https://gitee.com/glsnames/scoop-installer>
- 安装aria2, 可以多线程下载app
scoop install aria2
scoop config aria2-warning-enabled false
- 安装一些常用仓库
scoop bucket add extras
scoop bucket add versions
scoop install scoop-completion
scoop bucket add dorado <https://github.com/chawyehsu/dorado>
使用
https://github.com/ScoopInstaller/Scoop/wiki
scoop help #查看帮助
scoop help <某个命令> # 具体查看某个命令的帮助
scoop install <app> # 安装 APP
# 安装特定版本的 APP;语法 AppName@[version],示例
scoop install git@2.23.0.windows.1
scoop uninstall <app> # 卸载 APP
scoop list # 列出已安装的 APP
scoop search <app> # 搜索 APP
scoop status # 检查哪些软件有更新
# 显示某个app的信息
scoop info <app>
scoop update # 更新 Scoop 自身
scoop update appName1 appName2 # 更新某些app
scoop update * # 更新所有 app (前提是需要在apps目录下操作)
scoop hold <app> # 禁止某程序更新
scoop unhold <app> # 允许某程序更新
scoop bucket known #通过此命令列出已知所有 bucket(软件源)
scoop bucket add bucketName #添加某个 bucket
# 查看所有以下载的缓存信息
scoop cache show
scoop cache rm <app> # 移除某个app的缓存
# 清除所有缓存
scoop cache rm *
# 切换app版本
scoop reset [app]@[version]
备份迁移
- 在新电脑安装好 scoop ,Scoop 安装目录要和原来的一样,不一样的话自己进行调整下。
- 将根目录拷贝到新电脑的对应目录下
- 然后执行命令
scoop reset *