If you’ve ever used Linux then you’ll always want a Package Manager tool for Windows. Yes, Windows has a third-party Package Management tool called Chocolatey that can be run using the command line. However, Windows 10 has brought OneGet with its own Package Management tool as Microsoft’s Garret Serack announced in a blog post. It will allow you to install/uninstall and update software packages with NuGet Package Manager using Powershell. In addition, it also has support for Chocolatey repositories.
One manager for the package manager.
Note: With the release of Windows 10 RTM, OneGet has been renamed to Package Management.
So let’s see how you can efficiently install/uninstall and update multiple software packages using OneGet (Package Manager). Also, see how to integrate Chocolatey with it.
What is OneGet (Package Manager) and Chocolatey?
For non-Linux users and those who know nothing about package management, Package Manager makes installing, updating and uninstalling software (packages) very easy. The package manager uses a repository where all the software packages are stored.
You just need to enter a command to get those software packages and install them on your PC. With a single command, you can install or update software. Updates are performed automatically whenever software is updated in the repository. So that’s what Package Manager is all about.
Now, OneGet as a tool is one step ahead. It’s the Package Manager’s manager. It can host many repositories like Chocolatey and NuGet. We talked about Chocolatey before. Chocolatey can work with command prompt. NuGet contains software packages specifically for Microsoft Application Development tools. You can enter a single command and get software from these repositories.
How to use OneGet?
So let’s first look at the available commands. You can see it in the feature image above. To see the available commands, type the following in Powershell.
Get-Command -Module Package Manager
Remember, it’s not OneGet but PackageManagement (I’m writing here OneGet just for the sake of simplicity). So now you have the list of commands. Now let’s start by checking which package source (package manager) we have.
Get package source
Enter the following command (or just copy it):
Get-PackageSource
You will get Package Sources installed on your system.
So I just installed the built-in PowerShell collection. Now, install Chocolatey Package Manager. If you already see Chocolatey in the list then skip to the next step.
Install Chocolatey
Enter the following command:
Get-PackageProvider-Name Chocolatey
Get-PackageProvider will find the available package repositories and install it.
Fight Enter and the Chocolatey installation will begin. Once the installation is complete, check the package source again with the command you applied earlier. You will see Chocolatey.
Next, we need to set Chocolatey as the default Software Package source. we will use set-packagesource command to set it as default. Enter the following command:
Set-PackageSource -Name chocolatey
Now when we are ready, let’s install a piece of software from the chocolatey repository.
Install software from Chocolatey Repository
You have more options with Chocolatey. You don’t have to go to Chocolatey’s website and find the software you want to install. You can find that from Powershell itself using find package request. So let’s say you want to find all packages related to ‘Chrome’.
find Chrome package name
Now you will get all packages with Chrome browser keywords in it along with a summary. Now, from this list, I will install Adblockpluschrome.
installation package -named adblockpluschrome
Enter Y and the installation will begin.
There is no upgrade command
Surprisingly OneGet does not have Update request. There is an update command in Chocolatey but that command won’t apply here. This issue was reported on GitHub in 2014 when the Technical Preview was submitted to Insiders and it remains unresolved.
Want to be a Command Prompt Ninja? Here is a list of functional shortcuts that will help you become a shortcut.
Discover
Now that you know the basics, you can explore more commands and parameters. If you think OneGet doesn’t provide excellent service yet, you can always choose Chocolatey and use it via the Command line.
ALSO SEE: 3 command prompt alternatives that are better than the default
Categories: How to
Source: thpttranhungdao.edu.vn/en/