scoop

319 阅读3分钟

scoop安装

确保安装 PowerShell 5(或更高版本,包括PowerShell 核心)和.NET 框架 4.5(或更高版本)。

查看powershell 版本

Get-Host | Select-Object Version

在 PowerShell 中输入下面内容,保证允许本地脚本的执行:

set-executionpolicy remotesigned -scope currentuser

执行下面的命令安装 Scoop:

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

测试一下

scoop help

自定义安装路径

[environment]::setEnvironmentVariable('SCOOP','D:\Scoop','User')
$env:SCOOP='D:\Scoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

自定义路径 D:

将全局应用安装到自定义目录

假设目标目录是D:\Applications\Scoop\globalApps,在PowerShell命令控制台中运行:

scoop 卸载

scoop 安装软件

命令动作
search搜索软件名
install安装软件
update更新软件
status查看软件状态
uninstall卸载软件
info查看软件详情
home打开软件主页

下载加速

scoop install aria2

如果用了aria2还是很慢,可以关闭它:

scoop config aria2-enabled false

示例

scoop search git
scoop install git

全局安装

scoop install oraclejdk8 -g;

scoop 添加扩展软件包

known-application-buckets

由于 Scoop 的存储桶本质上都是一个个 git 库,所以想要添加额外的存储库,需要有 git 环境支撑,输入 scoop install git 进行安装即可。[^a]

输入 scoop bucket known 就能查看官方已知的存储桶列表

scoop bucket add <仓库名>
"extras": "https://github.com/lukesampson/scoop-extras.git",
"versions": "https://github.com/scoopinstaller/versions",
"nightlies": "https://github.com/scoopinstaller/nightlies",
"nirsoft": "https://github.com/kodybrown/scoop-nirsoft",
"php": "https://github.com/nueko/scoop-php.git",
"nerd-fonts": "https://github.com/matthewjberger/scoop-nerd-fonts.git",
"nonportable": "https://github.com/oltolm/scoop-nonportable",
"java": "https://github.com/se35710/scoop-java",
"games": "https://github.com/Calinou/scoop-games"

示例

scoop bucket add dorado https://github.com/h404bi/dorado
scoop install dorado/<App 名>

其他推荐存储桶

Bucket 地址:kodybrown/scoop-nirsoft

NirSoft 官网地址:NirSoft

scoop 常用命令

有关Scoop命令的信息是内置的。如果您使用Git,则应该找到熟悉的帮助界面。

要查看命令列表,请运行:

scoop help

要查看有关特定命令的帮助,请运行:

scoop help <command>

当前命令为(从的输出scoop help):

alias          Manage scoop aliases
bucket         Manage Scoop buckets
cache          Show or clear the download cache
checkup        Check for potential problems
cleanup        Cleanup apps by removing old versions
config         Get or set configuration values
create         Create a custom app manifest
depends        List dependencies for an app
export         Exports (an importable) list of installed apps
help           Show help for a command
hold           Hold an app to disable updates
home           Opens the app homepage
info           Display information about an app
install        Install apps
list           List installed apps
prefix         Returns the path to the specified app
reset          Reset an app to resolve conflicts
search         Search available apps
status         Show status and check for new app versions
unhold         Unhold an app to enable updates
uninstall      Uninstall an app
update         Update apps, or Scoop itself
virustotal     Look for app's hash on virustotal.com
which          Locate a shim/executable (similar to 'which' on Linux)

scoop help            #帮助
scoop list            #查看当前已安装软件
scoop info app        #查看软件信息
scoop install app     #安装软件
scoop search app      #搜索软件
scoop uninstall app   #卸载软件
scoop update app      #更新指定软件
scoop update *        #更新安装的软件和scoop

# 设置代理(http)
scoop config proxy 127.0.0.1:4412

示例:

  1. 列出已安装的所有包

    scoop list
    
  2. Scoop 命令说明

    scoop help
    
  3. 获取某个包的安装信息

    scoop info python
    
  4. 打开某个包的官网

    scoop home python
    
  5. 禁止某个包更新

    scoop hold python