placeholderScoop修炼手册

Scoop修炼手册

Scoop is an installer
The goal of Scoop is to let you use Unix-y programs in a normal Windows environment
Mike Zick

Scoop是一个 Windows 的下载工具,可以方便的安装各种软件。

Directory Structure

  • apps
  • buckets
  • cache
  • persist
  • shims
  • Apps: 安装的各个软件或程序

  • Buckets: 存放各种 app 的集合,buckets 目录下存放许多个 bucket,例如 main 为默认的 bucket,extras 包括部分未收录 main bucket 的常用软件,nerdfonts 为存放字体 app 的 bucket,每一个 bucket 都是一个 github 仓库,仓库里维护许多 app 的 json 文件,json 文件里存放了 app 的安装信息,包括 app 的版本,LICENSE,下载地址 url etc,这些 json 文件被称作 App manifest,下面是一个简单的示例

    {  "version": "1.0",  "url": "https://github.com/lukesampson/cowsay-psh/archive/master.zip",  "extract_dir": "cowsay-psh-master",  "bin": "cowsay.ps1"}
  • Cache: 存放下载的临时文件

  • Shims: scoop 在 environment variable 中添加了该目录;通过 scoop 安装的程序,scoop 会自动为其在 Shims 目录下生成一个对应的 exe 文件,这样程序安装后可以直接在命令行中调用。对于 GUI 程序,scoop 会自动在开始菜单中添加其快捷方式,目录C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Scoop Apps

Installation

默认安装到 C:\Users\<YOUR USERNAME>\scoop 目录下

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserInvoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

自定义安装目录

$ irm get.scoop.sh -outfile 'install.ps1'$ .\install.ps1 -ScoopDir 'D:\envir_vars\scoop\' -ScoopGlobalDir 'D:\envir_vars\scoop\GlobalApps' -NoProxy

已安装 Scoop 想迁移目录,参考Change Directory

迁移应用可通过 scoop export 导出 json 再 import,直接移动源目录文件 shims 无效(仍指向原目录)

Command

Install & Uninstall

  • scoop search vim 查找 app
  • scoop install neovim 安装指定 app
  • scoop install git@2.23.0.windows.1 安装指定版本 app
  • scoop install -g git 安装全局 app
    Install Options:
    -g, --global Install the app globally
    -i, --independent Don’t install dependencies automatically
    -k, --no-cache Don’t use the download cache
    -u, --no-update-scoop Don’t update Scoop before installing if it’s outdated
    -s, --skip Skip hash validation (use with caution!)
    -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it

  • scoop uninstall neovim 卸载指定软件
  • scoop uninstall -p python 卸载软件及其配置文件
  • scoop uninstall -g git 卸载全局软件

Update

  • scoop list List installed apps

  • scoop status Show status and check for new app versions

    Name      Installed Version Latest Version Missing Dependencies Info----      ----------------- -------------- -------------------- ----7zip      23.01             24.05aria2     1.36.0-1          1.37.0-1eza       0.18.15           0.18.16fastfetch 2.11.3            2.14.0fd        9.0.0             10.1.0git       2.42.0.2          2.45.1gitui     0.26.1            0.26.2kotlin    1.9.22            2.0.0neovim    0.9.5             0.10.0
  • scoop update update scoop

  • scoop update neovim 7zip aria2 更新指定软件

  • scoop update * 更新所有软件

  • scoop hold/update neovim hold 命令用于将某些应用程序"冻结",即禁止更新这些应用程序,unhold 是相应的"解冻"命令,解除对应用程序更新的限制

Clean

  • scoop cleanup git 清理指定软件的旧版本
  • scoop cleanup * 清理所有软件的旧版本
  • scoop cache rm * 清理下载软件时的缓存文件

MISC

在同一程序的不同版本之间切换

scoop reset python@3.10.6# do somethingscoop reset python@3.12.3
  • alias Manage scoop aliases
  • bucket Manage Scoop buckets
  • cat Show content of specified manifest.
  • checkup Check for potential problems
  • create Create a custom app manifest
  • depends List dependencies for an app, in the order they’ll be installed
  • download Download apps in the cache folder and verify hashes
  • export Exports installed apps, buckets (and optionally configs) in JSON format
  • help Show help for a command
  • home Opens the app homepage
  • import Imports apps, buckets and configs from a Scoopfile in JSON format
  • info Display information about an app
  • prefix Returns the path to the specified app
  • shim Manipulate Scoop shims
  • virustotal Look for app’s hash or url on virustotal.com
  • which Locate a shim/executable (similar to ‘which’ on Linux)

Ref

Scoop_Wiki

Scoop修炼手册

https://vluv.space/Scoop/

Author

GnixAij

Posted

2024-06-01

Updated

2026-04-06

License