OneGet: Package Manager for Windows 10
Windows 10 has brought a lot of UI changes and new features in its new preview build 9860. In this article I will discuss its newly introduced and most powerful feature, 'OneGet', a Linux-style package manager for Windows.
According to Wikipedia, "A package manager is a collection of software tools that automates the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner."
It typically maintains a database of software dependencies and version information to prevent software mismatches and missing prerequisites. Here instead of an application they call it a 'Package'. Hence the name Package Manage'. A package also contains metadata, like software's name, its purpose, version number, and vendor and lists all dependencies necessary for the software to run properly. Installing and updating software will become much easier when done with package managers.So, what exactly is the concept behind these package managers?
Let me explain from a Linux point of view. They have got different distributions compiled with different compiler options and use different versions of software while designing their kernel. So compatibility issues occur for the same software on different distributions. Because of all these confusions, application websites provide download links for different Linux distributions. Thank god, Windows is free from all these as we need to download a .exe file, just double-click and it works like magic.
To make user free from all these headaches, each Linux distribution holds its own software repositories. They contain software packages compiled specially for their platform.
Below are the steps performed in a package manager during installation of software.
1. User requests installation of a package/software.
2. It finds all the needed packages. It takes care of dependencies that needed to be installed along with this software.
3. It fetches all those packages from repository.
4. It will do all the configurations needed and installs silently with very less or minimal manual intervention.
Now, Microsoft has finally released its own version of package manager named OneGet. I listed some of the commands we use for finding resources, installations and un-installations in OneGet.OneGet Commands:
To execute commands of 'OneGet' package manager, we need to start Windows PowerShell. To open 'PowerShell' follow the below mentioned steps.
1. In Windows 7, typing 'powershell' at the start menu opens 'Windows Powershell' prompt.
2. In Windows 8, typing 'powershell' after opening start screen opens 'Windows PowerShell' prompt.
You can also open powershell through 'Windows Explorer'. Use keyboard shortcut "Alt+D" after opening windows explorer and type 'powershell' to open powershell prompt.
Get-Command -Module OneGet
- Lists out all the commands that can be performed on OneGet.
Get-PackageSource
- Lists out all the registered package sources or repositories.
Find-Package -Name SearchPattern
- Lists out all the packages that match with search pattern.
Examples:
1. Find-Package -Name Firefox
2. Find-Package -Name zoomit -AllVersions (Lists packages with different versions)
Install-Package -Name PackageName
- Installs the package of that PackageName.
Examples:
1. Install-Package -Name Firefox -Verbose (Prints all actions happening background)
2. Install-Package -Name Firefox -Force -Verbose (Forces the installation during conflicts in installation)
Register-PackageSource - Name PackageSourceName
- Registers new package source.
Example:
Register-PackageSource -Name chocolatey -Provider PSModule -Trusted -Location http://chocolatey.org/api/v2/ - Verbose
- Installs package source named 'chocolatey'. We have to provide each and every particular detail needed for its registration else it fails.
We can also choose our required software from a list of packages using the following command:
Find-Package | Out-Gridview -PassThru | Install-Package -Verbose
Final Verdict
Finally Microsoft entered into the race of command line installations of software officially in Windows 10. Even developers are planning to please Linux users by modifying their command line syntax similar to Linux distributions. More over user will be having ultimate control over installations as they do it from trusted repositories. OneGet might help in solving 'Windows System Clutter' issue which scatter files and registry entries all over the system and doesn't even clean up the mess after we uninstall those applications.
OneGet is completely Open Source. So at any point you can download .zip file from its GitHub repository and start experimenting on its source code. Like Linux which is developed as a community project, OneGet can be a huge hit in a short span of time.