Scoop - Windows下的包管理工具

安裝Scoop

確保已經(jīng)安裝了:

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!

參考

本文完

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末睬澡,一起剝皮案震驚了整個(gè)濱河市固额,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌煞聪,老刑警劉巖斗躏,帶你破解...
    沈念sama閱讀 212,542評(píng)論 6 493
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異昔脯,居然都是意外死亡啄糙,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,596評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門(mén)云稚,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)隧饼,“玉大人,你說(shuō)我怎么就攤上這事静陈⊙嘌悖” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 158,021評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵窿给,是天一觀的道長(zhǎng)贵白。 經(jīng)常有香客問(wèn)我率拒,道長(zhǎng)崩泡,這世上最難降的妖魔是什么? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 56,682評(píng)論 1 284
  • 正文 為了忘掉前任猬膨,我火速辦了婚禮角撞,結(jié)果婚禮上呛伴,老公的妹妹穿的比我還像新娘。我一直安慰自己谒所,他們只是感情好热康,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,792評(píng)論 6 386
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著劣领,像睡著了一般姐军。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上尖淘,一...
    開(kāi)封第一講書(shū)人閱讀 49,985評(píng)論 1 291
  • 那天奕锌,我揣著相機(jī)與錄音,去河邊找鬼村生。 笑死惊暴,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的趁桃。 我是一名探鬼主播辽话,決...
    沈念sama閱讀 39,107評(píng)論 3 410
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼卫病!你這毒婦竟也來(lái)了油啤?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 37,845評(píng)論 0 268
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤忽肛,失蹤者是張志新(化名)和其女友劉穎村砂,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體屹逛,經(jīng)...
    沈念sama閱讀 44,299評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡础废,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,612評(píng)論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了罕模。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片评腺。...
    茶點(diǎn)故事閱讀 38,747評(píng)論 1 341
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖淑掌,靈堂內(nèi)的尸體忽然破棺而出蒿讥,到底是詐尸還是另有隱情,我是刑警寧澤抛腕,帶...
    沈念sama閱讀 34,441評(píng)論 4 333
  • 正文 年R本政府宣布芋绸,位于F島的核電站,受9級(jí)特大地震影響担敌,放射性物質(zhì)發(fā)生泄漏摔敛。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 40,072評(píng)論 3 317
  • 文/蒙蒙 一全封、第九天 我趴在偏房一處隱蔽的房頂上張望马昙。 院中可真熱鬧桃犬,春花似錦、人聲如沸行楞。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,828評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)子房。三九已至形用,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間证杭,已是汗流浹背尾序。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,069評(píng)論 1 267
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留躯砰,地道東北人每币。 一個(gè)月前我還...
    沈念sama閱讀 46,545評(píng)論 2 362
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像琢歇,于是被迫代替她去往敵國(guó)和親兰怠。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,658評(píng)論 2 350

推薦閱讀更多精彩內(nèi)容