0%

【Windows/Scoop】Scoop 的安装使用

前言

今天逛 GitHub 看到 FluentTerminal,想到最近用 Windows Terminal 各种不舒服,如启动贼慢,历史记录没有。在 WT 没出来之前一直用的 Cmder,它里面带了很多 Linux 中的命令(grep,find,rm,vi,vim etc.),后来为了尝鲜 WT 放弃了 Cmder,现在又想重新回到 Cmder 的怀抱了 2333。

扯远了,安装 FluentTerminal 有几种方式,其中有一种就是用 Scoop 来安装,之前在实验室电脑上安装过,默认安装位置和安装应用都在 C 盘,强迫症表示很难受,搜了一下其实可以自定义安装位置和应用安装位置的,每次都要搜,索性这次记录下来。

介绍

Scoop 是什么,简单来说,Scoop 是 Windows 下的一款包管理器,类似于 Ubuntu 中的 apt,centOS 中的 yum,有了 Scoop 很多软件可以不用去找它的安装包而是可以直接 scoop install xxx 搞定,当然 Scoop 也并非所有软件都支持,你可以先用 scoop search xxx 搜一下,看是否能找到,如果有就可以直接安装,如果没有,那很抱歉,只能自行去找安装包。

安装

首先检查 Scoop 所需环境是否满足,见其 GitHub Requirements

如果满足下面就可以安装了。

  1. 自定义安装位置
1
2
3
4
5
# 设置环境变量
$env:SCOOP='D:\Programs\scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# 安装
iwr -useb get.scoop.sh | iex

测试是否安装成功

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
31
32
taseikyo :: D:\Programs\scoop » scoop help
Usage: scoop <command> [<args>]

Some useful commands are:

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)


Type 'scoop help <command>' to get help for a specific command.
  1. 自定义应用全局安装位置
1
2
3
4
5
6
# 设置环境变量(需要管理员权限)
$env:SCOOP_GLOBAL='D:\Programs\scoop'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
# 使用
scoop install -g sudo
sudo scoop install -g 7zip curl grep

Welcome to my other publishing channels