使用 scoop 安装管理 windows 软件

ref: (https://github.com/lukesampson/scoop)

1. 安装 scoop

1
set-executionpolicy remotesigned -s cu
  • 1.3 安装 scoop
1
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

2. 使用方法

  • 2.1 安装常用软件
1
2
3
4
5
6
7
8
9
10
11
scoop install sudo
scoop install git 7zip openssh
scoop install aria2
scoop install ffmpeg
scoop install nodejs
scoop install python

# 安装指定的版本,不要更新
scoop install python@3.6.8
scoop hold python
# scoop unhold python

  • git 配置
  • 右键菜单里添加 git bash here 的方法
  • 新建注册表文件 git bash here.reg, 内容如下(路径按需修改)
1
2
3
4
5
6
7
8
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Git Bash Here]
"ICON"="\"C:\\Users\\XXXX\\scoop\\apps\\git\\current\\git-bash.exe\""

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Git Bash Here\command]
@="\"C:\\Users\\XXXX\\scoop\\apps\\git\\current\\git-bash.exe\""

  • 2.2 安装 extras 库的软件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 添加库 extras 
scoop bucket add extras
# 安装
scoop install googlechrome
scoop install everything
scoop install screentogif
scoop install snipaste
scoop install vscode

# 添加库 versions, 可以安装其他(落后的)版本
scoop bucket add versions
scoop install python@3.7.7

# 添加库 jetbrains
scoop bucket add jetbrains
scoop install pycharm-professional

# 添加库 Ash258
scoop bucket add Ash258 'https://github.com/Ash258/scoop-Ash258.git'
scoop install potplayer

# 添加 第三方库 dorado
scoop bucket add dorado 'https://github.com/h404bi/dorado'
scoop install trafficmonitor
scoop install wechat
scoop install qqplayer
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"main": "https://github.com/ScoopInstaller/Main",
"extras": "https://github.com/lukesampson/scoop-extras",
"versions": "https://github.com/ScoopInstaller/Versions",
"nightlies": "https://github.com/ScoopInstaller/Nightlies",
"nirsoft": "https://github.com/kodybrown/scoop-nirsoft",
"php": "https://github.com/ScoopInstaller/PHP",
"nerd-fonts": "https://github.com/matthewjberger/scoop-nerd-fonts",
"nonportable": "https://github.com/oltolm/scoop-nonportable",
"java": "https://github.com/ScoopInstaller/Java",
"games": "https://github.com/Calinou/scoop-games",
"jetbrains": "https://github.com/Ash258/Scoop-JetBrains"
}
  • 2.3 其他命令
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 显示已安装软件
scoop list

# 显示可更新的软件
scoop status

# 更新scoop, 更新指定软件
scoop update
scoop update <app>
scoop update vscode-insiders -kf # 更新 nightly 版本


# 清理所有旧版软件, 清理指定软件, 清理过期的安装包
scoop cleanup *
scoop cleanup <app>

scoop cleanup -k * # 或 scoop cleanup --cache *


# 查找软件
scoop search <app>

# 显示软件信息(含必要配置说明)
scoop info <app>


用scoop管理软件,清爽多了,全部都在c:/user/xxx/scoop/app里,但是也有几个问题:

  • 好多软件是从官网,github,amazon下载的,网速比较渣,可以先安装aria2,安装后scoop会优先调用aria2来下载软件
  • 安装之后一般系统环境变量是设置好了的,但是有些软件的文件关联,右键菜单之类需要手动添加,可以先scoop info ,看看有没有相关配置说明参考

scoop 调用 aria2 的相关配置, 配置文件路径 c:/user/xxx/.config/scoop/config.json , 加入以下:

1
2
3
4
5
6
{
"aria2-enabled": true,
"aria2-retry-wait": 5,
"aria2-split": 10,
"aria2-min-split-size": "2M"
}

也可以用命令行 scoop config :

1
2
3
4
5
scoop config aria2-enabled true                   # default: true
scoop config aria2-retry-wait 8 # default: 2
scoop config aria2-split 8 # default: 5
scoop config aria2-max-connection-per-server 8 # default: 5
scoop config aria2-min-split-size] 2M # default: 5M