包管理工具 scoop(win)

发布时间:2021-03-13 01:32:00
更新时间:2021-03-13 01:42:31
文章作者:ZHUANGZHUANG

环境准备

$PSVersionTable.PSVersion.Major         # 查看 PowersShell 版本
$PSVersionTable.CLRVersion.Major        # 查看 .NET Framwork 版本

安装 scoop

set-executionpolicy remotesigned -scope currentuser  # 更改 PowerShell 脚本的执行策略
iwr -useb get.scoop.sh | iex                         # 安装 scoop

# 可能会安装失败,这是就要懂得科学
rm $env:HOMEPATH/scoop                               # scoop 的默认安装路径是 C:\User\<user>\scoop, 先删除,在重装
# $env:SCOOP='D:\Scoop'                              # 设置 SCOOP 环境变量,可以指定 scoop 的安装目录
iwr -useb get.scoop.sh | iex                         # 确保能正常访问 https://get.scoop.sh 后,安装 scoop
scoop help                                           # 查看帮助,检测是否安装成功

使用 scoop

scoop help                       # 查看帮助
scoop help <command>             # 查看具体某个命令的帮助

scoop search <app>               # 搜索软件包
scoop install <app>              # 安装软件包
scoop install git                # 安装 git
scoop install 7zip               # 安装 7zip
scoop uninstall <app>            # 卸载软件包

scoop search terminal
scoop bucket known               # 查看已知的软件库列表
scoop bucket add extras          # 添加软件库 extras
scoop install windows-terminal   # 安装 windows terminal

scoop install [email protected]       # 安装指定的版本
scoop hold python                # 禁止 Python 更新
scoop unhold python              # 允许 Python 更新

scoop status                     # 检查哪些软件包可以更新

scoop update                     # 更新 scoop
scoop update <app1> <app2>       # 更新软件包 qpp1 app2
scoop update *                   # 更新所有软件包

scoop list                       # 查看已经安装的软件包

scoop bucket add dorado https://github.com/h404bi/dorado    # 添加第三方软件库
scoop install dorado/<app>                                  # 从指定软件库中安装 app

scoop bucket list                # 查看添加的仓库列表
scoop bucket rm extras           # 移除软件库 extras

scoop cache                      # 查看软件包缓存
scoop cache rm <app>             # 删除某软件包的缓存
scoop cache rm *                 # 删除所有软件包的缓存

scoop cleanup <app>              # 删除某软件包的旧版本

scoop alias add <name> <command> <description>                       # 设置 scoop 别名
scoop alias add rm 'scoop uninstall $args[0]' 'Uninstall an app'     # 使用 scoop rm <app> 代替 scoop uninstall <app> 卸载软件包
scoop alias add upgrade 'scoop update *' 'Update all apps'           # 使用 scoop upgrade 代替 scoop update * 更新所有软件包

scoop alias list                 # 查看 scoop 别名
scoop alias list -v              # 查看 scoop 别名详情
scoop help                       # 可以查看到已经添加的别名
scoop alias rm rm                # 移除个刚刚添加的 rm 别名

scoop reset <app>@<version>      # 旧版本存在时,某 app 的多个版本之间切换
scoop reset <app>                # 某 app 切换到最新版本

scoop prefix git                 # 查看 git 安装路径
scoop info git                   # 查看 git 的安装信息
scoop home git                   # 用浏览器查看 git 的主页
scoop which git                  # 查看 git 命令的路径

scoop depends <app>              # 查看某软件包的依赖

scoop export > app.list          # 所有已经安装的软件包名,导出到 app.list 文件中

更新问题

# 大多数情况下,软件更新失败是因为国内 git pull 失败导致,可以尝试设置 git 代理解决

# 设置代理
git config --global http.proxy http://<ip>:<port>
git config --global https.proxy http://<ip>:<port>

# 查看代理设置
type ~/.gitconfig

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy

更多

​​​​​​​‌​‌​‌‌‌​‍​​​​‌​‌​​‌​​‌‌​‍​‌​‌​‌‌‌‌‌‌​​‌​‍​​​​‌‌​​​​​‌‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍‌​‌​​‌​‌‍‌​‌‌​‌‌‌‍‌​‌​‌​‌​‍‌​‌‌‌‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌​‌​​‌​‌‍‌​‌‌​‌‌‌‍‌​‌​‌​‌​‍‌​‌‌‌‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​​‌​‌‌‌‌‌‌‌‌​​​‍​‌‌​​‌‌‌​‌‌​​‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍​‌​‌‌​​‌‌‌‌‌​‌​‍​​​​‌​​​‌​‌‌‌‌​‍​​​‌​‌‌‌‌‌‌‌​​‌‍​‌​​​‌​​​​‌‌​‌​‍​‌​‌‌‌​‌​​​‌​​​‍‌‌​‌‌‌‌‌‍‌​​​‌‌​​‍‌​​‌‌‌​​‍‌​​‌​​​​‍‌​​‌​​​​‍‌​​​‌‌‌‌‍​​​​​​​​‌‌‌‌​‌‌‌‍‌​​​‌​​​‍‌​​‌​‌‌​‍‌​​‌​​​‌‍​​​​​​​​‌‌‌‌​‌‌​‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​‌‌​​​​‌​‌​​​‌‌‍​‌‌‌‌‌‌‌‌‌‌‌‌​‌​‍​​​​​​​​‌‌‌​​‌​‌‍‌​‌​​‌‌​‍‌​‌‌‌​‌‌‍‌​‌​​‌​‌‍‌‌​​‌‌‌​‍‌‌​​‌‌​‌‍‌‌​​‌‌​​‍‌‌​​‌​‌‌‍‌‌​​‌​‌​‍‌‌​​‌​​‌‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​‌​‌​​​‌‌​​‌‌‌‌‍​‌​‌​​​‌​‌‌‌‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌‌‍‌​​​‌​‌‌‍‌​​​‌‌‌‌‍‌​​​‌‌​​‍‌‌​​​‌​‌‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍‌​​​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌​‍‌​​‌‌‌‌​‍‌​​‌​​​‌‍‌​​‌‌​​​‍‌​​​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌​‍‌​​‌‌‌‌​‍‌​​‌​​​‌‍‌​​‌‌​​​‍‌‌​‌​​​‌‍‌​​‌​‌‌​‍‌​​‌​​​​‍‌​‌​​​‌‌‍‌‌​​‌‌​‌‍‌‌​​‌‌‌‌‍‌‌​​‌‌​‌‍‌‌​​‌‌‌​‍‌​‌​​​‌‌‍‌‌​​‌‌‌‌‍‌‌​​‌‌​​‍‌​‌​​​‌‌‍‌‌​​‌‌‌​‍‌‌​​‌‌​​‍‌​‌​​​‌‌‍‌​​​‌​​​‍‌​​‌​‌‌​‍‌​​‌​​​‌‍‌‌​‌​​‌​‍‌​​​‌‌​​‍‌​​‌‌‌​​‍‌​​‌​​​​‍‌​​‌​​​​‍‌​​​‌‌‌‌‍‌‌​‌​​​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌‌‍‌​​‌​​‌​‍‌​​‌​​‌‌

Repo:https://github.com/lukesampson/scoop

Wiki:https://github.com/lukesampson/scoop/wiki

撰写评论