scoop背景:
Scoop 是 Windows 的命令行安装程序(Command-Line Installer)
scoop的卸载:
查看scoop安装的应用
scoop list
卸载gradle
scoop uninstall gradle
卸载scoop
scoop uninstall scoop
scoop的安装:
打开Windows PowerShell(正常打开,不要以管理员身份运行)
非Administrator用户安装(推荐):
1、设置当前用户级别的PowerShell执行策略为"RemoteSigned",-Scope CurrentUser指定了该执行策略应用的范围
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
2、irm 是 Invoke-RestMethod 的缩写,从 get.scoop.sh 下载安装 Scoop 所需的 PowerShell 脚本,并将其保存为名为 install.ps1 的文件
irm get.scoop.sh -outfile 'install.ps1'
3、安装 Scoop 包管理器到 D:\Applications\Scoop 目录,并将全局应用安装到F:\GlobalScoopApps,同时在安装过程中不使用代理服务器
.\install.ps1 -ScoopDir 'D:\software\scoop\scoop' -ScoopGlobalDir 'D:\software\scoop\globle_scoop' -NoProxy
或者使用代理:
.\install.ps1 -ScoopDir 'Scoop_Path' -ScoopGlobalDir 'GlobalScoop_Path' -Proxy 'http://<ip:port>'
到此非Administrator打开方式的scoop安装已经完成
或者通过如下方式执行安装
$env:SCOOP='D:\software\scoop\scoop'
$env:SCOOP_GLOBAL='D:\software\scoop\globle_scoop'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
#从网上下载 Scoop 的安装脚本,并在下载完成后立即执行该脚本进行安装,是一种快速部署 Scoop 的方法
irm get.scoop.sh | iex
scoop update
如果修改了scoop的配置参数,使用scoop update使scoop更新到最新状态
scoop update
Administrator用户安装:
1、设置当前用户级别的PowerShell执行策略为"RemoteSigned",-Scope CurrentUser指定了该执行策略应用的范围
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
2、irm 是 Invoke-RestMethod 的缩写,从 get.scoop.sh 下载安装 Scoop 所需的 PowerShell 脚本,并将其保存为名为 install.ps1 的文件
irm get.scoop.sh -outfile 'install.ps1'
3、安装 Scoop 包管理器到 D:\Applications\Scoop 目录,并将全局应用安装到F:\GlobalScoopApps,同时在安装过程中不使用代理服务器
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
更换scoop的repo地址
scoop config SCOOP_REPO "https://gitee.com/scoop-installer/scoop"
scoop update
scoop的使用:
scoop下载gradle
scoop install gradle
# 安装 <AppName> 且禁止缓存安装包
scoop install -k <AppName>
# 安装 <AppName> 的指定版本 <Version>
scoop install <AppName>@<Version>
# 全局安装 <AppName>
$sudo scoop install <AppName> -g
# 全局安装 <AppName> 且禁止缓存安装包
sudo scoop install -gk <AppName>
查看scoop下载的应用
scoop list
删除scoop下载的gradle应用
scoop uninstall gradle
执行scoop help可查看scoop支持的参数:
scoop help
支持的指令说明如下:
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)