组织介绍

Scoop - 命令行式的 Windows 软件安装工具

安装 Scoop

  1. 打开 PowerShell 7.0+ (Core)Windows PowerShell 5.1 (Desktop)

  2. 设置执行策略

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  3. 下载安装脚本

    Invoke-RestMethod https://gitee.com/scoop-installer-mirrors/Install/releases/download/archive/install.ps1 -OutFile install.ps1
  4. 执行安装脚本 (请先查看下方的 其他注意事项)

    .\install.ps1 -ScoopDir "D:\scoop" -AddAbyssBucket
  5. 设置 scoop 仓库

    scoop config scoop_repo https://gitee.com/scoop-installer-mirrors/Scoop
  6. 使用 develop 分支以获取及时的快速修复和更新

    scoop config scoop_branch develop
  7. 添加 bucket

    • main

      scoop bucket add main https://gitee.com/scoop-installer-mirrors/Main
    • extras

      scoop bucket add extras https://gitee.com/scoop-installer-mirrors/Extras
      其他的 Known buckets
      • versions

        scoop bucket add versions https://gitee.com/scoop-installer-mirrors/Versions
      • nerd-fonts

        scoop bucket add nerd-fonts https://gitee.com/scoop-installer-mirrors/scoop-nerd-fonts
      • java

        scoop bucket add java https://gitee.com/scoop-installer-mirrors/Java
      • php

        scoop bucket add php https://gitee.com/scoop-installer-mirrors/PHP
      • nirsoft

        scoop bucket add nirsoft https://gitee.com/scoop-installer-mirrors/Nirsoft
      • sysinternals

        scoop bucket add sysinternals https://gitee.com/scoop-installer-mirrors/scoop-sysinternals
      • games

        scoop bucket add games https://gitee.com/scoop-installer-mirrors/scoop-games
  8. 优化 scoop search 的性能,它是非常快的,不需要第三方搜索工具

    scoop config use_sqlite_cache true

通过 abyss 提升 Scoop 使用体验

  • 添加 abyss bucket (GithubGitee)

    scoop bucket add abyss https://gitee.com/abgox/abyss

添加 scoop 命令补全以及 i18n 支持

  1. 使用 abgox/PSCompletions 添加 scoop 命令补全

    scoop install abyss/abgox.PSCompletions
    Import-Module PSCompletions
    psc add scoop scoop-install scoop-update
  2. 添加 i18n 支持 (由 abgox/scoop-i18n 提供)

    scoop install abyss/abgox.scoop-i18n

解决 Github 上的软件下载失败的问题

  • 如果网络条件有限,无法正常访问 Github 上的软件资源
  • 可以使用 abgox/scoop-tools
  1. 安装 scoop-installscoop-update

    scoop install abyss/abgox.scoop-install
    scoop install abyss/abgox.scoop-update
  2. 后续使用 scoop-installscoop-update 命令安装和更新软件即可

其他注意事项

git

  • scoop 是依赖 git 的,包括更新 scoop 自身、添加和更新 bucket,都需要 git 来完成

  • 如果在安装 scoop 时,还没有 git 命令,scoop 会自动安装 main bucket 中的 git

  • 但遗憾的是,这需要你有特殊的网络环境,能够正常访问 Github 上的软件资源

  • 否则,你可能需要手动安装 git

  • 或者使用 abyss 中的 abgox/scoop-tools: scoop-installscoop-update

  • 但同样遗憾的是,没有 git,你无法添加 abyss

  • 对此,install.ps1 提供了 -AddAbyssBucket 参数,它会自动添加 abyss 为临时的 bucket,和 main 一样

    .\install.ps1 -ScoopDir "D:\scoop" -AddAbyssBucket
  • 这样,你就可以先安装 scoop-install

    scoop install abyss/abgox.scoop-install
  • 然后,使用 scoop-install 安装 git

    scoop-install abyss/Git.Git
  • 同时,你还需要重新添加 main 和 abyss 这两个 bucket 以转换为 git 仓库

    scoop bucket add main https://gitee.com/scoop-installer-mirrors/Main
    scoop bucket add abyss https://gitee.com/abgox/abyss
  • 然后,更新 bucket

    scoop update

7z

  • 除了 git,scoop 还需要 7z 命令才能正常工作

  • 当需要解压软件包时,如果没有 7z 命令,scoop 会自动安装 main bucket 中的 7zip

  • 但遗憾的是,普通的网络环境有可能无法正常下载 https://www.7-zip.org 中的安装包

  • 这里比较推荐使用 NanaZip,它在 Github 中发布,提供了 7z 命令,且更现代化、更美观

  • 你可以使用 scoop-install 安装它

    scoop-install abyss/M2Team.NanaZip
  • 然后,启用外部的 7z 命令

    scoop config use_external_7zip true

全局安装目录

Important

Scoop 对 global 的处理仍然存在一些问题
对于普通用户,不建议使用它,也不需要使用它

  • 在运行 install.ps1 时,可以使用 -ScoopGlobalDir 参数指定全局安装目录

    1. 设置环境变量

      [Environment]::SetEnvironmentVariable("SCOOP_GLOBAL", "D:\scoop-global", "Machine")
    2. 执行安装脚本

      .\install.ps1 -ScoopDir "D:\scoop" -ScoopGlobalDir "D:\scoop-global"
  • 这样,当你使用 -g--global 参数时,scoop 会在 D:\scoop-global 中安装软件

    scoop install -g <app>
成就
3
Star
0
Fork
成员(1)
10931695 abgox 1767886677
abgox

搜索帮助