chocolatey_适用于Windows的Apt-Get-Windows 10上的OneGet和Chocolatey

chocolatey

chocolatey

In 2013 I asked the questions "Is the Windows user ready for apt-get?" As with nearly all my blog posts, the comments are better than the post itself. ;)

2013年,我问了一个问题:“ Windows用户准备好进行apt-get吗? ”与几乎所有我的博客帖子一样,评论比帖子本身要好。 ;)

Now it's 2015 and many of us are upgrading to Windows 10. One of the little gems in Windows 10 that no one is talking about (yet) is OneGet. You can read about OneGet architecture here.

现在是2015年,我们许多人都在升级到Windows 10OneGet是Windows 10中尚无人谈论的小瑰宝之一。 您可以在此处阅读有关OneGet架构的信息

Installing applications in Windows 10 from the command line

It's easy (and wrong) to just say that One-Get is Apt-Get for Windows. But OneGet isn't actually a package manager. It's more clever and cooler than that.  It's a package manager manager.

仅仅说One-Get是Windows的Apt-Get是很容易的(也是错误的)。 但是OneGet实际上并不是一个包管理器。 比这更聪明,更酷。 是包裹经理。

OneGet是包管理器的经理 (OneGet is a Manager of Package Managers )

Go out to you Windows 10 PowerShell prompt now and type "Get-PackageProvider" and you'll see the package managers you have registered with OneGet today.

立即向您显示Windows 10 PowerShell提示符,然后键入“ Get-PackageProvider”,您将看到今天已在OneGet中注册的程序包管理器。

C:\> Get-PackageProvider

Name Version
---- -------
Programs 10.0.10240.16384
msu 10.0.10240.16384
msi 10.0.10240.16384
PSModule 1.0.0.0

Usually programs are installed with things like MSIs, for example, so there's a provider for that. You can type "Get-Package" and see the programs AND packages on your machine:

例如,通常程序会安装有MSI之类的东西,因此有一个提供程序。 您可以键入“ Get-Package”,然后在计算机上查看程序和软件包:

C:\> Get-Package

Name Version
---- -------
123D Design R1.6 1.6.41
Windows Driver Package - Ge... 06/04/2011 8....
Windows Driver Package - Ge... 06/19/2014 8....
Windows Driver Package - FT... 01/27/2014 2....
JRuby 1.7.19 1.7.19
Windows Driver Package - ST... 11/09/2009 3....
EPSON NX410 Series Printer ...
Intel Edison Device USB driver 1.2.1

Since it's PowerShell, you can sort and filter and what-not to your heart's delight.

由于是PowerShell,您可以进行排序和筛选,而不必担心。

OneGet不是微软的巧克力 (OneGet isn't Microsoft's Chocolately)

Chocolatey is an open source apt-get-like machine-wide package manager that you can use today, even if you don't have Windows 10.

Chocolatey是一个类似于apt-get的开源机器范围包管理器,即使您没有Windows 10,今天也可以使用它。

OneGet isn't Microsoft's version of Chocolately. But there is a beta/preview Chocolatey provider that plugs into OneGet so you can use OneGet to get Chocolatey packages and install them.

OneGet不是Microsoft的Chocolately版本。 但是有一个Beta / Preview Chocolatey提供程序可以插入OneGet,因此您可以使用OneGet获取Chocolatey软件包并安装它们。

Other things worth noting, even though OneGet is in the box for Windows 10, you can still run it on Windows 7 and Windows 2008 R2. Plus, OneGet isn't done and it's open source so there's lots of cool possibilities.

其他值得注意的是,即使Windows 10附带了OneGet,您仍然可以在Windows 7和Windows 2008 R2上运行它。 另外, OneGet还没有完成,它是开源的,因此有很多不错的可能性。

Oh, and an important naming point. Just like "Chromium" is the open source browser and "Chrome" is the Google packaged instance of that project, "OneGet" is the open source project and what ships with Windows 10 is just generically "PackageManagement." Just a good reminder of the relationship between open source projects and their shipping counterparts.

哦,这是重要的命名要点。 就像“ Chromium”是开放源代码浏览器,而“ Chrome”是该项目的Google打包实例一样,“ OneGet”是开放源代码项目,Windows 10附带的内容通常是“ PackageManagement”。 很好地提醒了开源项目与其运输同行之间的关系。

在Windows 10上使用OneGet和Chocolatey安装VLC (Installing VLC using OneGet and Chocolatey on Windows 10)

Example time. You've got a new Windows 10 machine and you want to get VLC. You can (and should) totally get it from the Windows Store, but let's get it using Package Management.

时间示例。 您有一台新的Windows 10计算机,并且想要获得VLC。 您可以(应该)从Windows应用商店中完全获取它,但让我们使用“程序包管理”来获取它。

Here I need to get the beta Chocotlatey provider first, and once, with "get-packageprovider -name chocolatey." Also, when I install a package for the first time it will prompt to download NuGet as well. I will answer Yes to both.

在这里,我需要首先使用“ get-packageprovider -name Chocolatey”获得Beta Chocotlatey提供程序。 另外,当我第一次安装软件包时,它也会提示下载NuGet。 我对两者都回答“是”。

NOTE: You can also install Chocolatey explicitly with "install-package –provider bootstrap chocolatey"

注意:您也可以使用“ install-package –provider bootstrap chocolatey”显式安装Chocolatey

Now I can just "install-package vlc" and it will get it from the Chocolatey repository.

现在,我可以“ install-package vlc”,它将从Chocolatey存储库中获取。

C:\>  get-packageprovider -name chocolatey

The provider 'chocolatey v2.8.5.130' is not installed.
chocolatey may be manually downloaded from https://oneget.org/ChocolateyPr30.exe and installed.
Would you like PackageManagement to automatically download and install 'chocolatey'?

[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y

Name Version
---- -------
Chocolatey 2.8.5.130

C:\> install-package vlc

The provider 'nuget v2.8.5.127' is not installed.
nuget may be manually downloaded from https://oneget.org/nuget-anycpu-2.8.5.127.exe and installed.
Would you like PackageManagement to automatically download and install 'nuget' now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y

The package(s) come from a package source that is not marked as trusted.
Are you sure you want to install software from 'chocolatey'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y

Name Version Source Summary
---- ------- ------ -------
vlc 2.2.1.20150630 chocolatey VLC Media Player

Boom. Now VLC is installed. It's early days but it's interesting stuff!

繁荣。 现在已安装VLC。 现在还很早,但是很有趣!

You can read about the available OneGet cmdlets at https://github.com/OneGet/oneget/wiki/cmdlets.

您可以在https://github.com/OneGet/oneget/wiki/cmdlets上了解可用的OneGet cmdlet。

For example here I can find the latest version of zoomit.

例如,在这里我可以找到zoomit的最新版本。

C:\> find-package -name zoomit

Name Version Source
---- ------- ------
zoomit 4.50 chocolate

Just to be clear, with regards to OneGet and Chocolatey.

明确一点,关于OneGet和Chocolatey。

  1. It's an unsupported version of Chocolatey provider in a GitHub repo

    这是GitHub存储库中不受支持的Chocolatey提供程序版本
  2. Folks can download it using OneGet cmdlets and then using the unsupported provider, you can download Chocolatey packages.

    人们可以使用OneGet cmdlet下载它,然后使用不受支持的提供程序来下载Chocolatey软件包。
  3. Microsoft is working with the community to take ownership of Chocolatey provider.

    Microsoft正在与社区合作以取得Chocolatey提供程序的所有权。

And again, you can use Chocolatey TODAY on your Windows 7 and up machines as it is.

同样,您可以按原样在Windows 7及更高版本的计算机上使用Chocolatey TODAY。

使用OneGet和PackageManagement管理MSI安装的程序 (Managing MSI-installed Programs with OneGet and PackageManagement)

OneGet and PackageManagement in Windows 10 lets you manage package managers of all kinds to control what's installed one your machines. For example, I can uninstall an MSI installed program like this. This is just like visiting Add/Remove Programs (ARP) and uninstalling, except I did it from the command line!

Windows 10中的OneGet和PackageManagement使您可以管理各种程序包管理器,以控制在一台计算机上安装了什么。 例如,我可以这样卸载MSI安装的程序。 这就像访问“添加/删除程序(ARP)”并进行卸载一样,只是我是从命令行完成的!

C:\> Uninstall-Package join.me.launcher

Name Version
---- -------
join.me.launcher 1.0.368.0

MSI and Chocolately are just the start for OneGet. What if one package management API could also get Python or PHP packages? Windows Store apps?

MSI和Chocolately只是OneGet的开始。 如果一个包管理API也可以获取Python或PHP包怎么办? Windows Store应用程序?

捐款帮助Chocolatey (Donate to help Chocolatey)

Last, but definitely not least, it's important to remember that Chocolatey and the Chocolatey Repository of Packages can use your help and sponsorship. Head over to https://chocolatey.org/ and scroll to the bottom and click Donate and you can Paypal or use your Credit Card to help them out.

最后但并非最不重要的一点是,请务必记住Chocolatey和Packages的Chocolatey存储库可以使用您的帮助和赞助。 转到https://chocolatey.org/并滚动到底部,然后单击“捐赠”,您可以使用Paypal或使用信用卡来帮助他们。

SOCIAL: Hey folks, please do follow me on Facebook https://fb.me/scott.hanselman or Twitter! https://twitter.com/shanselman

社会:嗨伙计们,请不要跟我在Facebook上https://fb.me/scott.hanselman或Twitter! https://twitter.com/shanselman

翻译自: https://www.hanselman.com/blog/aptget-for-windows-oneget-and-chocolatey-on-windows-10

chocolatey

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值