5

I am confused about Chocolatey, and OneGet (renamed later Package Management).

Does one currently just install chocolatey, and use it, if one is on Windows 10 Pro RTM, which supposedly shipped with OneGet cmdlets inside powershell already? (They don't appear to exist on my Windows 10 Pro machine).

First, the practical question: How does one install and work with Package Management (formerly OneGet) inside Windows 10? On my machine if I type get-command -Module OneGet I get NO results. No cmdlet with a name like Get-PackageProvider currently exists on my machine. Yet I read that OneGet would be part of, or ship in Windows 10 RTM. I also read you can add the one-get cmdlets using Import-Module but I can't get that to work, either.

Second, the comprehension question: Is OneGet really a meta-manager for what will in the future be a variety of sources with Chocolatey being only one repository source, or have I misunderstood? I have read that things are "in flux" right now. What is the situation and when will it be cleaned up?

Warren P
  • 2,931
  • 8
  • 37
  • 53
  • related: http://superuser.com/questions/952223/how-to-get-oneget-packagemanagement-to-work-on-windows-10-home – Warren P Sep 22 '15 at 17:30
  • [OneGet simply uses the `Chocolatey` application repository.](http://superuser.com/questions/957712/how-do-i-use-windows-10-built-in-package-manager/970766#970766) – Ramhound Sep 22 '15 at 17:34
  • But is it on every windows system or NOT? I believe that is a valid question worthy of clarification. – Warren P Sep 22 '15 at 17:48
  • OneGet from my understanding is a package manager aggregator that seeks to provide a common interface to all the different package managers. – ferventcoder Sep 22 '15 at 21:38
  • OneGet may work with Chocolatey packages, but it also may not. At the moment, I would stick with using OneGet for PowerShell gallery items and others, but probably not with Chocolatey until the official version comes out. It's not ready yet, but when it is, there will be announcements. – ferventcoder Sep 22 '15 at 21:40
  • 1
    The "in flux" could be that the OneGet developer at Microsoft moved on to other projects so some things (like the Chocolatey provider work) have not been brought up to speed yet, plus the developers helping with the Chocolatey provider integration have been blocked on either Choco adding features and/or no longer having a OneGet developer to review the work. – ferventcoder Sep 22 '15 at 21:41
  • Ok. And I should definitely point out that if you just use chocolatey via the choco command then it works on other versions of Windows than just Windows 10, which is good. – Warren P Sep 23 '15 at 18:03
  • OneGet was renamed **PackageManagement** in 2016. @WarrenP Should we update the title? See https://github.com/OneGet/oneget/commit/4e3969e1496030ae5ab1f071f5e5def093be91a7 – yzorg Apr 26 '18 at 20:32
  • Yes, title updated – Warren P Apr 27 '18 at 21:13

2 Answers2

5

It looks like it IS installed, and that the pre-release blog posts that say to type Import-Module -Name OneGet are no longer correct, for Win10 rtm.

However, you still need to manually add a package source like this, from an Administrator-privilege level PowerShell, in Windows 10 professional:

Register-PackageSource -Name chocolatey -Location https://chocolatey.org/api/v2 -Provider PSModule -Trusted -Verbose

You can search like this:

Find-Package paint -provider Chocolatey

Above should find the actual choco package name of Paint.net for me.

Then you can install something like this:

Install-Package paint.net -provider Chocolatey

(For example, to install Paint.NET).

enter image description here

If you can't find Install-package cmdlet (it appears like it is not installed?) switch from regular non-elevated powershell, to an elevated (Administrator) powershell.

Warren P
  • 2,931
  • 8
  • 37
  • 53
  • 4
    Register the location as https, not http. Otherwise there is no verification that you are hitting the secure source. – ferventcoder Sep 22 '15 at 22:17
  • Looks like you can also do a `Find-Package sysinternals -ProviderName chocolatey` and it will prompt to install the chocolatey package provider. It will do that for all the default providers. Based on the help, that's `{Programs | msu | msi | Bootstrap | PSModule | Chocolatey | nuget | chocolatey}`. Unsure if it's officially supported right now. – lordcheeto Oct 28 '15 at 02:16
  • It appears that you now need to run `Install-PackageProvider -Name chocolatey` first in order to use Chocolatey as a package provider: https://github.com/OneGet/oneget/issues/182 – CMCDragonkai Jul 31 '16 at 08:35
2

I'm not sure why you've been downvoted, but one way to look at the current mess that is the Windows package ecosystem is that the OneGet is the new and officially-sanctioned (by MS) package manager for Windows 10 (and beyond). OneGet is "inspired by" Chocolatey, to an extent that it can use the same repository/upstream provider as the Chocolatey sources.

OneGet shipped in Windows 10 RTM and is included in the PowerShell. It's not really "ready" for use with 3rd party packages yet, though the idea is that at some point Microsoft will (maybe?) unveil a 3rd party repository/ecosystem to supplant Chocolatey's, though if that's still going to happen at all is anyone's guess now.

For now, to use OneGet instead of Chocolatey (which basically gives you no advantage other than not having to install Chocolatey), you can tack on the command line -provider Chocolatey to your OneGet commands to have them connect to and use the Chocolatey provider.

Mahmoud Al-Qudsi
  • 3,766
  • 4
  • 35
  • 39
  • What are the one-get commands that you speak of? I can't find any such commands on my system. Do I have to download a .psd1 for OneGet from GitHub? If so, how is it true to say it "is included in the powershell"? – Warren P Sep 22 '15 at 17:44
  • According to this, it is included in RTM but then it contradicts itself and says WMF 5 must first be installed: https://github.com/OneGet/oneget – Mahmoud Al-Qudsi Sep 22 '15 at 18:15
  • 1
    @MahmoudAl-Qudsi - `WMF 5` is included in the version of `Powershell` installed out of the box on Windows 10 machines – Ramhound Sep 22 '15 at 18:58
  • It looks like it IS installed, but only usable from elevated (Admin) powershell. – Warren P Sep 22 '15 at 19:35
  • 3
    Is it possible to use OneGet to install Chocolatey, and from then on, only use Chocolatey commands like `choco install`? – CMCDragonkai May 23 '16 at 19:10