Windows裡的Apt-Get (OneGet)

來源:互聯網
上載者:User

標籤:windows   應用程式   管理工具   正式版   第三方   

2015年,隨著大家陸續升級到Windows 10,期待已久的包管理工具OneGet也成為了Win10的標配。

OneGet最早在Win8.1時期作為可選功能推出, OneGet經過了幾個大版本的更新後,伴隨著Win10正式版一併發布, OneGet讓使用者可以像Linux系統一樣,通過簡單的命令列操作來管理應用程式包

接下來由我簡單介紹一下OneGet的基本用法

** OneGet包括如下命令 **

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/OneGet.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="OneGet.png" />

說到OneGet一定要提一下Chocolatey,Chocolatey是目前最流行的Windows第三方包管理器。與其說OneGet是包管理器,倒不如說OneGet是包管理器的管理器。 我們通過如下命令可以得到預設情況下Win10裡面的包管理器

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Get-PackageProvider.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Get-PackageProvider.png" />

Chocolatey不在預設安裝包裡,需要執行Get-PackageProvider -Name Chocolatey將其安裝到Win10

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Get-PackageProvider2.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Get-PackageProvider2.png" />

再次執行Get-PackageProvider,檢查Chocolatey是否安裝成功

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Get-PackageProvider3.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Get-PackageProvider3.png" />

接下來就可以利用Chocolatey的資源進行apt-get的操作了,下面通過curl展示一下OneGet的強大實力

首先需要尋找curl是否存在Find-Package -provider chocolatey curl

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Find-Package.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Find-Package.png" />

確定curl存在之後,執行安裝命令Install-Package curl

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Install-Package.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Install-Package.png" />

添加C:\Chocolatey\bin到環境變數PATH中

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/ENV.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="ENV.png" />

這次可以看到可以正常工作的curl工具了

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/curl.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="curl.png" />

刪除剛才的程式,執行卸載命令Uninstall-Package curl

650) this.width=650;" class="img-responsive img-thumbnail" src="http://blog.huangchaosuper.cn/resources/windows/Uninstall-Package.png" style="border:1px solid rgb(221,221,221);vertical-align:middle;height:auto;padding:4px;line-height:1.42857143;background-color:rgb(255,255,255);" alt="Uninstall-Package.png" />

好了,大家實驗一下吧!!!

http://blog.huangchaosuper.cn/tech/2015/08/10/win10-oneget/

本文出自 “好了,是我” 部落格,請務必保留此出處http://huangchaosuper.blog.51cto.com/5221102/1684196

Windows裡的Apt-Get (OneGet)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.