在 Windows 上安装 scoop

一、前言

  • 个人主页: ζ小菜鸡
  • 大家好我是ζ小菜鸡,让我们一起学习在 Windows 上安装 scoop。
  • 如果文章对你有帮助、欢迎关注、点赞、收藏(一键三连)

二、 scoop是什么

  windows下的安装源搜索工具,有点类似centos下的yum和Ubuntu下的apt。用这个拉下来安装的软件没有广告。

  scoop官方网址: https://scoop.sh/

在这里插入图片描述


三、安装条件

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

1.查看powershell版本

$PSVersionTable.PSVersion

  在powershell中,执行上述命令,如图所示:

在这里插入图片描述


2.更改脚本执行策略(必须)

set-executionpolicy remotesigned -s cu

  在powershell中,执行上述命令,如图所示:

在这里插入图片描述


四、安装

1.设置环境变量

$env:SCOOP='D:\Scoop'

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


2.安装命令

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

## 或者

iwr-useb get.scoop.sh|iex

  事实上,上面两个目前都是不可用的,如图所示:

在这里插入图片描述
  不慌,遇到这种问题先排除一下raw.githubusercontent.com未能解析?手动ping了一下还真没回复,查下是不是真的没有解析:https://www.ipaddress.com/

在这里插入图片描述
  能ping通,剩下就是改host的事情了:

  Windows:

code C:\Windows\System32\drivers\etc

  执行以上命令,如下图所示:

在这里插入图片描述
  或手动修改hosts文件,如图所示:

在这里插入图片描述

  添加以下内容:

120.245.114.115 raw.githubusercontent.com

  手在ping raw.githubusercontent.com,如下图所示:

在这里插入图片描述
  再以下命令(非管理员运行):

irm get.scoop.sh | iex

```bash
iwr -useb get.scoop.sh | iex
 
Initializing...
Downloading...
Extracting...
Creating shim...
Adding D:\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.

scoop update

3.检查安装

  通过 scoop 或 scoop help 命令查看使用简介,若输出帮助信息,说明安装成功:

scoop
scoop help

  输出:

Usage: scoop [<COMMAND>] [<OPTIONS>]

Windows command line installer

General exit codes:
0 - Everything OK
1 - No parameter provided or usage shown
2 - Argument parsing error
3 - General execution error
4 - Permission/Privileges related issue
10+ - Number of failed actions (installations, updates, ...)

Type 'scoop help <COMMAND>' to get help for a specific command.

Available commands are:

alias       Manage scoop aliases.
bucket      Manage local scoop buckets.
cache       Show or clear the download cache.
cat         Show content of specified manifest(s).
checkup     Check system for pontential problems.
cleanup     Perform cleanup on specified installed application(s) by removing old/not actively used versions.
config      Get or set configuration values into scoop configuration file.
depends     List dependencies for an application.
download    Download manifest files into cache folder.
export      Export (an importable) list of installed applications.
help        Show help for specific scoop command or scoop itself.
hold        Hold an application(s) to disable updates.
home        Open the application's homepage in default browser.
info        Display information about an application.
install     Install specific application(s).
list        List installed applications.
prefix      Return the location/path of installed application.
reset       Force binaries/shims, shortcuts, environment variables and persisted data to be re-linked.
search      Search for applications, which are available for installation.
status      Show status and check for available updates for all installed applications.
unhold      Unhold an installed application(s) to enable updates.
uninstall   Uninstall specified application(s).
update      Update installed application(s), or scoop itself.
utils       Wrapper around utilities for maintaining buckets and manifests.
virustotal  Search virustotal database for potential viruses in files provided in manifest(s).
which       Locate the path to a shim/executable of application that was installed with scoop (similar to 'which' on Li
            nux).


  在 Windows 上安装 scoop学习到此就结束了,感谢大家阅读,如果文章对你有帮助、欢迎关注、点赞、收藏(一键三连)


猜你喜欢

转载自blog.csdn.net/weixin_45191386/article/details/130662281
今日推荐