Scoop: Windows下的包管理器 -- 配置记录

377 阅读1分钟

参考文档

过程记录

  1. 下载 get.scoop.sh 文件,命名为 install.ps1
irm get.scoop.sh -outfile 'install.ps1'
  1. 设置全局环境变量
$env:SCOOP='D:\MyPrograms\Scoop'
$env:SCOOP_GLOBAL='D:\MyPrograms\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'Machine')
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
  1. 指定目录下载 Scoop
.\install.ps1 -ScoopDir <Custom ScoopDir> -ScoopGlobalDir <Custom ScoopGlobalDir> -NoProxy

e.g.

.\install.ps1 -ScoopDir 'D:\MyPrograms\Scoop' -ScoopGlobalDir 'D:\MyPrograms\GlobalScoopApps' -NoProxy
  1. 换源
  • Scoop - A command-line installer for Windows.
scoop config SCOOP_REPO https://gitcode.net/mirrors/ScoopInstaller/Scoop
  • main - Default bucket for the most common (mostly CLI) apps
scoop bucket add main https://gitcode.net/mirrors/ScoopInstaller/Main
scoop bucket add extras https://gitcode.net/mirrors/ScoopInstaller/Extras
  • versions - Alternative versions of apps found in other buckets
scoop bucket add versions https://gitcode.net/mirrors/ScoopInstaller/Versions
  • java - A collection of Java development kits (JDKs), Java runtime engines (JREs), Java's virtual machine debugging tools and Java based runtime engines.
scoop bucket add java https://gitcode.net/mirrors/ScoopInstaller/Java
  1. 刷新配置
scoop update
  1. 检查换源是否成功
scoop config
        root_path    : D:\MyPrograms\Scoop
        global_path  : D:\MyPrograms
        last_update  : 2022-12-06T12:00:11.1730787+08:00
        scoop_branch : master
        scoop_repo   : https://gitcode.net/mirrors/ScoopInstaller/Scoop
scoop bucket list
        Name     Source                                                      
        ----     ------                                                          
        extras   https://gitcode.net/mirrors/ScoopInstaller/Extras  
        java     https://gitcode.net/mirrors/ScoopInstaller/Java         
        main     https://gitcode.net/mirrors/ScoopInstaller/Main     
        versions https://gitcode.net/mirrors/ScoopInstaller/Versions   
  1. 安装git
  • 加速下载,不然安装git让你慢到怀疑人生
 scoop install aria2
  • 单任务最大连接数设置为 32,单服务器最大连接数设置为 16,最小文件分片大小设置为 1M
scoop config aria2-split 32 
scoop config aria2-max-connection-per-server 16 
scoop config aria2-min-split-size 1M 
  • 安装git
scoop install git
  1. 常用命令
  • scoop search - 搜索软件
  • scoop install - 安装软件
  • scoop info - 查看软件详细信息
  • scoop list - 查看已安装软件
  • scoop uninstall - 卸载软件,-p删除配置文件。
  • scoop update - 更新 scoop 本体和软件列表
  • scoop update - 更新指定软件
  • scoop update * - 更新所有已安装的软件
  • scoop checkup - 检查 scoop 的问题并给出解决问题的建议
  • scoop help - 查看命令列表
  • scoop help - 查看命令帮助说明*