安裝Scoop
確保已經(jīng)安裝了:
- PowerShell 5(或更高版本宣旱,包括PowerShell Core)
- .Net Framework 4.5(或更高版本)
Windows10基本上都滿足菲盾。
以下命令都在Powershell中執(zhí)行武契!
Scoop默認(rèn)安裝到C:\Scoop目錄吠谢,如果你像我一樣需要換一個(gè)安裝目錄诵姜,先做一點(diǎn)點(diǎn)額外的工作(注意替換為你安裝Scoop的目錄):
$env:SCOOP='D:\Scoop'
[environment]::setEnvironmentVariable('SCOOP',$env:SCOOP,'User')
然后運(yùn)行如下內(nèi)容佩伤,進(jìn)行Scoop的安裝
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
iwr -useb get.scoop.sh | iex
輸入scoop
出現(xiàn)幫助信息即安裝成功:
Usage: scoop <command> [<args>]
Some useful commands are:
alias Manage scoop aliases
bucket Manage Scoop buckets
cache Show or clear the download cache
checkup Check for potential problems
cleanup Cleanup apps by removing old versions
config Get or set configuration values
create Create a custom app manifest
depends List dependencies for an app
export Exports (an importable) list of installed apps
help Show help for a command
hold Hold an app to disable updates
home Opens the app homepage
info Display information about an app
install Install apps
list List installed apps
prefix Returns the path to the specified app
reset Reset an app to resolve conflicts
search Search available apps
status Show status and check for new app versions
unhold Unhold an app to enable updates
uninstall Uninstall an app
update Update apps, or Scoop itself
virustotal Look for app's hash on virustotal.com
which Locate a shim/executable (similar to 'which' on Linux)
Type 'scoop help <command>' to get help for a specific command.
查找軟件
我們找個(gè)aria2來(lái)試試静暂,Scoop甚至默認(rèn)使用aria2來(lái)進(jìn)行多連接下載
scoop search aria2
在main倉(cāng)庫(kù)中找到:
'main' bucket:
aria2 (1.35.0-1)
安裝軟件
找到以后济丘,開(kāi)始安裝:
scoop install aria2
安裝成功:
Installing 'aria2' (1.35.0-1) [64bit]
Loading aria2-1.35.0-win-64bit-build1.zip from cache
Checking hash of aria2-1.35.0-win-64bit-build1.zip ... ok.
Extracting aria2-1.35.0-win-64bit-build1.zip ... done.
Linking D:\Scoop\apps\aria2\current => D:\Scoop\apps\aria2\1.35.0-1
Creating shim for 'aria2c'.
'aria2' (1.35.0-1) was installed successfully!
更新軟件
使用status來(lái)查看軟件狀態(tài)
# 查看一個(gè)軟件的狀態(tài)
scoop status aria2
# 查看已經(jīng)安裝的全部軟件的(更新)狀態(tài)
scoop status
結(jié)果:
Scoop is up to date.
Updates are available for:
bandizip: 7.09 -> 7.13
curl: 7.71.1 -> 7.73.0_5
everything: 1.4.1.986 -> 1.4.1.1000
fastcopy: 3.86 -> 3.92
ffmpeg: 4.2.2 -> 4.3.1-26
fork: 1.55.5 -> 1.56.1
git: 2.29.2.windows.1 -> 2.29.2.windows.2
IntelliJ-IDEA-Ultimate: 2020.2.3-202.7660.26 -> 2020.3-203.5981.155
microsoftedge: 86.0.622.68 -> 87.0.664.52
nodejs: 14.2.0 -> 15.3.0
ojdkbuild8: 1.8.0.252-2.b09 -> 1.8.0.275-1.b01
postman: 7.21.2 -> 7.36.0
shadowsocks: 4.1.9.2 -> 4.3.0.0
tomcat: 9.0.33 -> 9.0.40
typora: 0.9.89 -> 0.9.96
youtube-dl: 2020.11.24 -> 2020.12.02
結(jié)果里顯示的是可以進(jìn)行升級(jí)的軟件(再也不用煩惱每個(gè)軟件都來(lái)催你更新了)。
可以對(duì)指定的軟件進(jìn)行更新:
scoop update curl
也可以全部更新:
scoop update *
卸載軟件
使用uninstall來(lái)卸載
scoop uninstall aria2
Bucket(倉(cāng)庫(kù))
官方的main倉(cāng)庫(kù)主要包含無(wú)界面的軟件(鍵盤(pán)黨喜笑顏開(kāi))洽蛀,好消息是社區(qū)維護(hù)了一批倉(cāng)庫(kù)摹迷,你可以這樣查看有哪些:
scoop bucket known
目前有這些
main
extras
versions
nightlies
nirsoft
php
nerd-fonts
nonportable
java
games
jetbrains
比如,把extra裝上郊供,畢竟是known峡碉,所以無(wú)需指定git倉(cāng)庫(kù)
scoop bucket add extra
如果需要添加第三方的倉(cāng)庫(kù),則需要指定倉(cāng)庫(kù)地址了:
scoop bucket add <倉(cāng)庫(kù)名> <倉(cāng)庫(kù)地址>
處理失敗
前面的介紹聽(tīng)起來(lái)很不錯(cuò)對(duì)吧驮审,實(shí)際上由于上網(wǎng)的科學(xué)性鲫寄,加上Scoop里面相當(dāng)多的App都發(fā)布在github上吉执,你可能經(jīng)常性地遭遇到一個(gè)幾兆幾十兆的軟件大半個(gè)小時(shí)下載不了,還經(jīng)常下載失敗塔拳,像這樣:
scoop install potplayer
Installing 'potplayer' (201021) [64bit]
Starting download with aria2 ...
Download: Download Results:
Download: gid |stat|avg speed |path/URI
Download: ======+====+===========+=======================================================
Download: d91ea6|ERR | 0B/s|D:/Scoop/cache/potplayer#201021#https_t1.daumcdn.net_potplayer_PotPlayer_Version_201021_PotPlayerSetup64.exe_dl.7z
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 2) Timeout
ERROR https://t1.daumcdn.net/potplayer/PotPlayer/Version/201021/PotPlayerSetup64.exe#/dl.7z
referer=https://t1.daumcdn.net/potplayer/PotPlayer/Version/201021/PotPlayerSetup64.exe#/
dir=D:\Scoop\cache
out=potplayer#201021#https_t1.daumcdn.net_potplayer_PotPlayer_Version_201021_PotPlayerSetup64.exe_dl.7z
ERROR & 'D:\Scoop\apps\aria2\current\aria2c.exe' --input-file='D:\Scoop\cache\potplayer.txt' --user-agent='Scoop/1.0 (+http://scoop.sh/) PowerShell/5.1 (Windows NT 10.0; Win64; x64; Desktop)' --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=12148 --continue --summary-interval 0
Please try again or create a new issue by using the following link and paste your console output:
https://github.com/lukesampson/scoop-extras/issues/new?title=potplayer%40201021%3a+download+via+aria2+failed
從錯(cuò)誤信息里面鼠证,我們可以找到其下載地址,即ERROR中的referer靠抑,用你自己的途徑(看好你哦)下載過(guò)來(lái)量九,然后改名為out指定的值,并移至dir指定的目錄中颂碧。
以上面安裝potplayer失敗為例:
- App的下載地址為:
https://t1.daumcdn.net/potplayer/PotPlayer/Version/201021/PotPlayerSetup64.exe
,手動(dòng)下載后 - 改名為
potplayer#201021#https_t1.daumcdn.net_potplayer_PotPlayer_Version_201021_PotPlayerSetup64.exe_dl.7z
- 然后移動(dòng)到目錄
D:\Scoop\cache
這時(shí)只是手動(dòng)做了下載這一步的工作荠列,安裝還需要:
# 前面安裝失敗,scoop仍然會(huì)認(rèn)為已經(jīng)安裝载城,這里卸載一下肌似,scoop會(huì)認(rèn)為已經(jīng)卸載了
scoop uninstall potplayer
# 再次安裝,scoop從cache目錄會(huì)找到我們下好的app進(jìn)行安裝
scoop install potplayer
至此诉瓦,安裝成功
have fun!
參考
- Scoop
- 「一行代碼」搞定軟件安裝卸載川队,用 Scoop 管理你的 Windows 軟件
- scoop——強(qiáng)大的Windows命令行包管理工具
- 給 Scoop 加上這些軟件倉(cāng)庫(kù),讓它變成強(qiáng)大的 Windows 軟件管理器
本文完