tags: 软件配置/scoop windows/scoop

1. scoop安装条件

  • Windows 7 以上
  • 64位系统
  • powershell 3 以上

查看powershell版本:

1
$PSVersionTable.PSVersion

2. 安装

2.1 设置环境变量

1
2
3
$env:SCOOP='D:\Scoop'

[Environment]::SetEnvironmentVariable('SCOOP',$env:SCOOP,'User')

此步骤非必需,若无此步骤,scoop文件夹以及未来安装的软件都会放在C盘。因此建议自定义安装路径。

2.2 安装命令

1
2
3
4
5
6
7
8
9

# 脚本执行策略更改
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
# 输入Y或A,同意
Y
# 执行安装命令
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
## 或者
iwr-useb get.scoop.sh|iex

由于墙的原因,如果网络环境没有配置好,可能会无法访问,造成此步骤报错。可以使用国内的镜像下载源。

1
2
3
4
5
6
# 脚本执行策略更改
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
# 输入Y或A,同意
Y
# 执行安装命令
iwr -useb scoop.201704.xyz | iex

2.3 检查

以上步骤无报错运行完后,可以输入一下命令,看是否出现帮助文档。若出现,则为安装成功。

1
scoop help

若出现以下内容,则为安装成功。

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
27
28
29
30
Command    Summary
------- -------
alias Manage scoop aliases
bucket Manage Scoop buckets
cache Show or clear the download cache
cat Show content of specified manifest.
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, 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
hold Hold an app to disable updates
home Opens the app homepage
import Imports apps, buckets and configs from a Scoopfile in JSON format
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
shim Manipulate Scoop shims
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 or url on virustotal.com
which Locate a shim/executable (similar to 'which' on Linux)

scoop的使用方法,查阅以上帮助文档即可,无需单独说明。

3. 配置

3.1 镜像配置

需要更换scoop的国内镜像,可以使用一下命令:

1
2
3
4
# 更换scoop的repo地址(此仓库为个人建立的镜像,若失效,自行百度其他的即可)
scoop config SCOOP_REPO 'https://gitee.com/glsnames/scoop-installer'
# 拉取新库地址
scoop update

切换回官方镜像:

1
scoop config SCOOP_REPO 'https://github.com/ScoopInstaller/Scoop'

3.2 添加bucket

必装git,scoop及bucket更新均依赖此软件。若以安装,可以忽略此步骤。

1
scoop install git

查看官方维护的bucket:

1
scoop bucket list

添加已知bucket:

1
scoop bucket add extras

添加第三方bucket:

1
2
3
4
5
# 基本语法
scoop bucket add <别名> <git地址>

# 举例添加scoopcn([Mostly Chinese applications / 大多是国内应用程序
scoop bucket add scoopcn https://github.com/scoopcn/scoopcn.git

3.3 配置代理

1
2
3
4
# 添加代理 根据实际需要,填写http代理信息
scoop config proxy 127.0.0.1:7890
# 删除代理
scoop config rm proxy

端口号和ip根据自己代理情况而定

4. Bucket推荐

bucket不建议设置过多,可能会造成搜索软件或者下载软件时,浪费大量索引时间。以下为推荐的bucket。

1
2
3
4
5
6
7
scoop bucket add dorado https://github.com/h404bi/dorado
scoop bucket add extras https://github.com/ScoopInstaller/Extras
scoop bucket add java https://gitee.com/scoop-bucket/main.git
scoop bucket add lemon https://github.com/hoilc/scoop-lemon
scoop bucket add main https://github.com/ScoopInstaller/Main
scoop bucket add versions https://github.com/ScoopInstaller/Versions.git
scoop bucket add zapps https://github.com/kkzzhizhou/scoop-zapps