Scoop介绍
scoop是Windows下的包管理工具
安装环境要求
1,操作环境:win10
2,确保你的 PowerShell 版本 >= 3. win7或许低于3,得升级。如何确认PowerShell,在powershell 命令窗口输入
$PSVersionTable.PSVersion
3,确保你允许PowerShell执行本地脚本,在PowerShell中输入如下内容后,选择yes或则A
set-executionpolicy remotesigned -scope currentuser
安装Scoop
在PowerShell中输入如下内容(默认安装目录C:\Users\user(自己的用户名)\scoop):
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
想要指定安装目录,在PowerShell中输入如下内容(代码中的C:\Scoop为指定的目录):
[environment]::setEnvironmentVariable('SCOOP','c:\Scoop','User')$env:SCOOP='C:\Scoop'iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
等待安装完成。
Scoop安装完成后
输入以下命令查看Scoop命令的概述:
scoop help
结果显示如下:
1 PS C:\Users\Alex.k.wang> scoop help 2 Usage: scoop[ ] 3 4 Some useful commands are: 5 6 alias Manage scoop aliases 7 bucket Manage Scoop buckets 8 cache Show or clear the download cache 9 checkup Check for potential problems10 cleanup Cleanup apps by removing old versions11 config Get or set configuration values12 create Create a custom app manifest13 depends List dependencies for an app14 export Exports (an importable) list of installed apps15 help Show help for a command16 home Opens the app homepage17 info Display information about an app18 install Install apps19 list List installed apps20 prefix Returns the path to the specified app21 reset Reset an app to resolve conflicts22 search Search available apps23 status Show status and check for new app versions24 uninstall Uninstall an app25 update Update apps, or Scoop itself26 virustotal Look for app's hash on virustotal.com27 which Locate a shim/executable (similar to 'which' on Linux)28 29 30 Type 'scoop help ' to get help for a specific command.
输入'scoop help <command>'可以查看具体的某个命令的用法,如下所示:
scoop help install
显示结果如下:
1 PS C:\Users\Alex.k.wang> scoop help install 2 Usage: scoop install[options] 3 4 e.g. The usual way to install an app (uses your local 'buckets'): 5 scoop install git 6 7 To install an app from a manifest at a URL: 8 scoop install https://raw.github.com/lukesampson/scoop/master/bucket/runat.json 9 10 To install an app from a manifest on your computer11 scoop install \path\to\app.json12 13 When installing from your computer, you can leave the .json extension off if you like.14 15 Options:16 -g, --global Install the app globally17 -i, --independent Don't install dependencies automatically18 -k, --no-cache Don't use the download cache19 -s, --skip Skip hash validation (use with caution!)20 -a, --arch <32bit|64bit> Use the specified architecture, if the app supports it
查找要安装的程序,如gradle:
scoop search gradle
显示结果如下:
1 PS C:\Users\Alex.k.wang> scoop search gradle2 'main' bucket:3 gradle-bin (5.1.1)4 gradle (5.1.1)
查找所有可用程序:
scoop search
安装程序,如gradle,默认会安装到Scoop安装目录下的apps目录:
scoop install gradle
显示结果如下:
1 PS C:\Users\alex.k.wang> scoop install gradle2 Installing 'gradle' (5.1.1) [32bit]3 gradle-5.1.1-all.zip (124.7 MB) [> ] 1%
也可将程序安装到指定目录,如F:\GlobalScoopApps:
[environment]::setEnvironmentVariable('SCOOP_GLOBAL','c:\GlobalScoopApps','Machine')$env:SCOOP_GLOBAL='c:\GlobalScoopApps'scoop install -g
对Scoop进行版本更新:
scoop update
对Scoop安装的所有程序进行更新(也可指定某个程序进行更新):
scoop update *
posted on 2019-03-10 14:07 阅读( ...) 评论( ...)