win10 软件资源包管理------scoop

包管理器: 通过一条简洁的命令管理安装卸载软件的管理包,linux系统的标配。

scoop 是为win10平台的开发的包管理器,Scoop 由澳洲程序员Luke Sampson于2015年创建。 只要一条命令简化win系统繁琐安装, 统一的安装位置,不用为软件默认安装位置发愁。

scoop 只需要在安装scoop 时配置好安装软件路径。 这个特点也让scoop 极易备份,重装系统后,一个语句就可以还原所有软件,体验超高效率。

mac平台有类似的homebrew, linux平台的apt、yum,下面开始安装步骤:

安装scoop

  1. 开始 按钮右击 按 A 键 进入PowerShell
    开始右键菜单.png

  2. 打开远程部署

Set-ExecutionPolicy RemoteSigned -scope CurrentUser;
  1. 配置软件安装目录
$env:SCOOP='d://scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')

全局目录看自己需求(默认路径C:\ProgramData\scoop)

$env:SCOOP_GLOBAL='D:\scoop\global'
[environment]::setEnvironmentVariable('SCOOP_GLOBAL',$env:SCOOP_GLOBAL,'Machine')
  1. 直接国内一键安装脚本
    scoop-CN: 🥄 scoop 国内一键安装脚本 (gitee.com)
iwr -useb https://gitee.com/RubyKids/scoop-cn/raw/master/install.ps1 | iex

软件安装

scoop install git 7zip

# 配置 aria2 加速下载
scoop install aria2

# sudo 用于添加临时管理员权限
scoop install sudo

# lxrunoffline 安装win子系统用到
scoop install lxrunoffline

# 自动补全scoop命令
scoop install scoop-completion

自动补全命令临时生效

Import-Module "$($(Get-Item $(Get-Command scoop.ps1).Path).Directory.Parent.FullName)\modules\scoop-completion"

自动补全永久生效

  • 查看 $profile 的路径, 在指定的文件中添加上方命令
$profile
  • $profile不存在, 自动创建
if (!(Test-Path $profile)) { New-Item -Path $profile -ItemType "file" -Force }

软件库管理

# 查看官方库 按需求添加
scoop bucket known

# 添加官方库 extras
scoop bucket add extras

# 查看已装库
scoop bucket 

第三方库推荐(scoopet, dorado, scoop-raresoft)

scoop bucket add https://github.com/chawyehsu/dorado

# 科研软件
scoop bucket add scoopet https://github.com/ivaquero/scoopet 

# 破解软件
scoop bucket add https://github.com/L-Trump/scoop-raresoft

scoop 库排行榜
image.png

scoop 还原

scoop 尽量安装非系统盘, 重装系统后,还原操作:

  • 原来的软件安装目录改名/或移动到其他目录
  • 完成scoop安装
  • 等新安装的目录出来, 用原来的替换掉
  • 最后运行 scoop reset * 还原安装的软件

其他

善用帮助文件

# 查看scoop命令
scoop -h
# 查看任何功能的帮助文件
scoop alias -h
scoop bucket -h
scoop update -h
posted @ 2022-03-19 13:48  lghgo  阅读(136)  评论(0编辑  收藏  举报