Scoop windows下的包管理器

Goohugo發表於2024-09-02

Scoop 安裝

環境需求

  • PowerShell 5 +
  • .NET Framework 4.5 +
    scoop-01

安裝

指定安裝位置(配置環境變數)

以管理員身份開啟PowerShell

$env:SCOOP='D:\Applications\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')

安裝Scoop

首先確保你能訪問 raw.githubusercontent.com

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# 或者
iwr -useb get.scoop.sh | iex
irm https://cdn.jsdelivr.net/gh/duzyn/scoop-cn/install.ps1 | iex
irm https://ghproxy.com/raw.githubusercontent.com/duzyn/scoop-cn/master/install.ps1 | iex

Scoop 使用

Scoop官方維護的倉庫

  • main - 預設倉庫
  • extras - 預設倉庫的補充超級強大
  • games - 看名字就知道啦
  • nerd-fonts - Nerd Fonts
  • nirsoft - A subset of the 250 Nirsoft apps
  • java - Installers for Oracle Java, OpenJDK, Zulu, ojdkbuild, AdoptOpenJDK, Amazon Corretto, BellSoft Liberica & SapMachine
  • jetbrains - Installers for all JetBrains utilities and IDEs
  • nonportable - Non-portable apps (may require UAC)
  • php - Installers for most versions of PHP
  • versions - Alternative versions of apps found in other buckets

可以直接透過scoop bucket add <repo_name>安裝

由於某些原因,每次更新倉庫的時間奇慢,所以還是換為國內映象倉庫來增加使用體驗

映象倉庫

  • main

  • extras

  • dorado

執行以下命令安裝必裝軟體

scoop install aria2 git 7zip

反正你肯定要用到!
或者

scoop install https://ghproxy.com/raw.githubusercontent.com/duzyn/scoop-cn/master/bucket/7zip.json
scoop install https://ghproxy.com/raw.githubusercontent.com/duzyn/scoop-cn/master/bucket/git.json
scoop install https://ghproxy.com/raw.githubusercontent.com/duzyn/scoop-cn/master/bucket/aria2.json

或者

scoop install https://cdn.jsdelivr.net/gh/duzyn/scoop-cn/bucket/7zip.json
scoop install https://cdn.jsdelivr.net/gh/duzyn/scoop-cn/bucket/git.json
scoop install https://cdn.jsdelivr.net/gh/duzyn/scoop-cn/bucket/aria2.json

對aria2進行設定

scoop config aria2-split 3 
scoop config aria2-max-connection-per-server 3 
scoop config aria2-min-split-size 1M

對scoop_repo進行更改

scoop config SCOOP_REPO https://gitee.com/scoop-bucket/scoop

執行以下命令訂閱軟體倉庫

scoop bucket rm main
scoop bucket add main https://mirror.nju.edu.cn/git/scoop-main.git
scoop bucket add extras https://mirror.nju.edu.cn/git/scoop-extras.git

以上兩個是官方bucket的國內映象,所有軟體建議優先從這裡下載。

scoop bucket add dorado https://gitee.com/scoop-bucket/dorado.git

使用Scoop安裝常用軟體

scoop install 7zip aria2 python vscode typora vlc sumatrapdf

每次新增完倉庫記得更新一下!

scoop update

另外附上常用命令

scoop update  #更新倉庫
scoop update *  #更新所有軟體
scoop list  #列出已安裝的軟體
scoop bucket list  #列出已訂閱的倉庫

相關文章