Scoop 包管理

介绍

用于Windows的命令行安装程序。

brew apt-get yum 类似,不过是用于 Windows。

安装

安装要求

  • PowerShell Terminal 5.1 以上 (Win10 及以上操作系统

如何安装

打开 PowerShell 并运行

PS C:\> irm get.scoop.sh -outfile 'install.ps1'
# 默认安装目录是你的用户目录\Scoop,但是中文用户名会存在兼容问题。建议指定 D:\Scoop 为安装目录可以解决此问题
PS C:\> .\install.ps1 -RunAsAdmin -ScoopDir 'D:\Scoop' 
PS C:\> iex "& {$(irm get.scoop.sh)} -RunAsAdmin"

卸载

PS C:\> scoop uninstall scoop

快速上手

# 搜索包
PS C:\> scoop search nginx

# 安装包
PS C:\> scoop install nginx

# 卸载包
PS C:\> scoop uninstall nginx

# 查看已安装包
PS C:\> scoop list

# 清除缓存
PS C:\> scoop cleanup

常用工具安装

# nvm
PS C:\> scoop install nvm

# python39
PS C:\> scoop bucket add versions
PS C:\> scoop install versions/python39

# php8.3
PS C:\> scoop bucket add versions
PS C:\> scoop install versions/php83

# mysql5.7
PS C:\> scoop bucket add versions
PS C:\> scoop install versions/mysql57
# 在后台启动: mysqld --standalone
# 在终端启动: mysqld --console

# 题外话, 运行 nginx
# 1. 直接运行: start nginx
# 2. 注册成为服务:
#       scoop services add nginx
#       scoop services start nginx

关于Docker

还是不建议使用 scoop 去安装,只能运行 Windows镜像 推荐安装 "Docker For Desktop", 可以通过开启 Hyper-V 来支持 Linux 容器

Last Updated:
Contributors: 余小波