scoop-軟體包管理器

姬雨晨發表於2024-06-10

scoop

scoop官網 https://scoop.sh/

專案github地址 https://github.com/ScoopInstaller/Scoop

安裝scoop

Set-ExecutionPolicy RemoteSigned       修改指令碼執行策略
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression       安裝scoop

安裝軟體

  1. git

scoop及bucket更新均依賴此軟體,如果電腦上已經手動那裝過,只需要在環境變數path下新增git目錄即可。

  1. innounp

一個依賴的元件(可以不裝,後面裝軟體的時候會自動安裝)

scoop bucket add main
scoop install main/innounp
  1. wingetui
scoop bucket add extras
scoop install extras/wingetui
  1. aria2 用於scoop加速下載
PS C:\Users\zbf> scoop download extras/powertoys
INFO  Downloading 'powertoys' [64bit] from extras bucket
Starting download with aria2 ...
Download: 06/07 13:06:17 [ERROR] CUID#8 - Download aborted. URI=https://github.com/microsoft/PowerToys/releases/downloadDownload: Exception: [AbstractCommand.cc:351] errorCode=19 URI=https://objects.githubusercontent.com/github-production-release-asset-2e65be/184456251/53f539fe-9eb4-4888-bc2d-c45ba4f796d1?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240607%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240607T050606Z&X-Amz-Expires=300&X-Amz-Signature=1cac772561f206fd1bf0cc515fe2e5de2c574e85b67fc3948ba14625dab39afc&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=184456251&response-content-disposition=attachment%3B%20filename%3DPowerToysUserSetup-0.81.1-x64.exe&response-content-Download:   -> [AbstractCommand.cc:789] errorCode=19 CUID#8 - Name resolution for objects.githubusercontent.com failed:TDownload: Download Results:
Download: gid   |stat|avg speed  |path/URI
Download: ======+====+===========+=======================================================
Download: 859f9f|ERR |       0B/s|C:/Users/zbf/scoop/cache/powertoys#0.81.1#https_github.com_microsoft_PowerToys_releases_download_v0.81.1_PowerToysUserSetup-0.81.1-x64.exe
Download: Status Legend:
Download: (ERR):error occurred.
Download: aria2 will resume download if the transfer is restarted.
Download: If there are any errors, then see the log file. See '-l' option in help/man page for details.

ERROR Download failed! (Error 19) Name resolution failed
ERROR https://github.com/microsoft/PowerToys/releases/download/v0.81.1/PowerToysUserSetup-0.81.1-x64.exe
    referer=https://github.com/microsoft/PowerToys/releases/download/v0.81.1/
    dir=C:\Users\zbf\scoop\cache
    out=powertoys#0.81.1#https_github.com_microsoft_PowerToys_releases_download_v0.81.1_PowerToysUserSetup-0.81.1-x64.exe

ERROR & 'C:\Users\zbf\scoop\apps\aria2\current\aria2c.exe' --input-file='C:\Users\zbf\scoop\cache\powertoys.txt' --user-agent='Scoop/1.0 (+http://scoop.sh/) PowerShell/7.4 (Windows NT 10.0; Win64; x64; Core)' --allow-overwrite=true --auto-file-renaming=false --retry-wait=2 --split=5 --max-connection-per-server=5 --min-split-size=5M --console-log-level=warn --enable-color=false --no-conf=true --follow-metalink=true --metalink-preferred-protocol=https --min-tls-version=TLSv1.2 --stop-with-process=2524 --continue --summary-interval=0 --auto-save-interval=1

Please try again or create a new issue by using the following link and paste your console output:
https://github.com/ScoopInstaller/Extras/issues/new?title=powertoys%400.81.1%3a+download+via+aria2+failed
PS C:\Users\zbf>

aria2報錯,那就關閉aria2

scoop config aria2-enabled false

scoop環境詳解

scoop的目錄

C:\Users\xxxxx\scoop
buckets          軟體源
cache            軟體的下載快取
apps             scoop安裝的所有軟體都會裝在這個目錄下
persist          應用程式的使用者資料
shims            一些應用程式的啟動程式或指令碼
  • apps下的每個軟體的data都link到persist下軟體對應的data

  • 每個軟體都是用currentlink到當前版本

源的json檔案裡面都是下載地址

scoop常用命令

#幫助手冊
scoop help 或者 scoop /?
scoop bucket /?

 scoop checkup                               #檢查scoop的問題 

scoop bucket list
scoop bucket known
scoop bucket add <別名> <git地址>
scoop bucket add 名稱
scoop bucket rm <別名>

scoop search <query>                        #在已新增的源中搜尋軟體
scoop info <app>                            #檢視軟體資訊
scoop list                                  #列出scoop已安裝的軟體

scoop install aria2
scoop uninstall aria2

scoop download extras/powertoys             #下載指定軟體

scoop hold <軟體名>                          #禁止指定軟體更新
取消禁止更新使用 unhold

scoop update                                #更新scoop
scoop update <app>                          #更新指定軟體
scoop update *                              #更新所有軟體   或使用 -a

scoop cache show                            #檢視scoop的下載快取
scoop cache rm <app>                        #刪除指定軟體的下載快取
scoop cache rm *                            #刪除所有軟體的下載快取   或使用 -a

scoop cleanup                               #清理scoop舊版本
scoop cleanup <app>                         #清理指定程式的舊版本
*  或  -a                                   #清理所有軟體的舊版本
-k, --cache                                 #清理過時下載快取

scoop reset <軟體名@版本號>                  #切換到指定版本

scoop export -c > scoopfile.json            #匯出app列表、源列表
scoop cat scoopfile.json                    #檢視列表內容
scoop import scoopfile.json                 #根據匯入的app列表安裝軟體

# 新增代理 根據實際需要,填寫http代理資訊
scoop config proxy 127.0.0.1:4412
# 刪除代理
scoop config rm proxy

scoop create /?
scoop config /?

常見bucket

官方bucket

scoop bucket add extras
scoop bucket add versions
scoop bucket add nirsoft
scoop bucket add sysinternals
scoop bucket add php
scoop bucket add nerd-fonts
scoop bucket add nonportable
scoop bucket add Java

scoop bucket add games  #會報錯

其他三方bucket

scoop bucket add jetbrains

手冊 https://gitee.com/scoop-installer/scoop
目前已知bucket已映象至gitee,可訪問 https://gitee.com/organizations/scoop-installer/projects 獲取對應bucket庫連線

# 舉例新增scoopcn([Mostly Chinese applications / 大多是國內應用程式](https://github.com/scoopcn/scoopcn))
scoop bucket add scoopcn https://gitee.com/scoop-installer/scoopcn

scoop bucket add dorado https://github.com/chawyehsu/dorado
scoop bucket add Ash258 https://github.com/Ash258/Scoop-Ash258
scoop bucket add scoopet https://github.com/integzz/scoopet
scoop bucket add 42wim https://github.com/42wim/scoop-bucket.git
# raresoft 破解版軟體集合
scoop bucket add raresoft https://github.com/L-Trump/scoop-raresoft

更多:https://lzw.me/a/scoop.html/comment-page-1

https://github.com/lzwme/scoop-proxy-cn
https://github.com/scoopcn/scoopcn

相關文章