Chocolatey Package Manager
In today's Ask the Admin, Russell Smith looks at the Chocolatey package manager for Windows, what it does, and how it can simplify software deployment on servers and end-user devices. “Chocolatey is a package manager for Windows (like apt-get but for Windows). It was designed to be a decentralized In this article, I will describe how to install and use the Chocolatey Package Manager on Windows. ***** Thanks for watching our videos! If you want more, check us out online at the following places.
Forget the Windows Store. Microsoft is working on a Linux-style package management framework for Windows, and it’s included with Windows 10. It’s being tested with Chocolatey’s existing packages, and allows you to easily install desktop applications and other software.
This is huge news. If you’ve ever used Linux, you’ve probably wanted a package management system for the Windows desktop ever since. Now it’s finally arriving!
Note: in the RTM release OneGet has been renamed to PackageManagement.
OneGet, a Package Management Framework for Windows
This package manager is called OneGet, and is shipping as part of PowerShell. In a blog post titled “My little secret : Windows PowerShell OneGet” over at Technet, Microsoft’s Garret Serack explains:
“OneGet is a unified interface to package management systems and aims to make Software Discovery, Installation and Inventory (SDII) work via a common set of cmdlets (and eventually a set of APIs). Regardless of the installation technology underneath, users can use these common cmdlets to install/uninstall packages, add/remove/query package repositories, and query a system for the software installed. Included in this CTP is a prototype implementation of a Chocolatey-compatible package manager that can install existing Chocolatey packages.”
As OneGet is part of the latest version of PowerShell, it’s included by default in the Windwos 10 Technical Preview. It’s also available as part of the Windows Management Framework 5.0 Preview for Windows 8.1.
Just look at the image at the top of this article to see how it will all work. Yes, you can install VLC or another piece of Windows software that easily! After you run the command, OneGet will locate the package in your configured package sources, download it to your computer, and install it — all automatically. And there should be graphical user interfaces for this, too, so it’ll just take a few clicks.
Windows geeks, celebrate! The era of an officially supported Windows package manager is now almost here!
@chrisbhoffman @brians198 okay, sit down. Microsoft is working on #oneget, a pkg mgr aggregator, that will include a choco client in Win10
— Rob Reynolds (@ferventcoder) October 27, 2014
(Currently, OneGet is in flux. The initial version of OneGet shipped with Chocolatey as its sole default repository, but Chocolatey has now been removed from the default configuration. A Chocolatey package source will soon be available for easy installation via OneGet. You can currently install the Chocolatey package source with a command, but Chocolatey’s packages wouldn’t actually install on our system after doing so. This is a minor roadbump in development.)
How OneGet Works
Let’s dig in a bit deeper. Here’s how Microsoft describes OneGet:
“OneGet is a new way to discover and install software packages from around the web. With OneGet, you can:
- Manage a list of software repositories in which packages can be searched, acquired, and installed
- Search and filter your repositories to find the packages you need
- Seamlessly install and uninstall packages from one or more repositories with a single PowerShell command”
The Get-PackageSource cmdlet lets you view a list of installed package sources, or repositories. OneGet now includes two Microsoft-provided sources. Chocolatey was previously the default package source during development and can easily be added.
Anyone can create and operate a repository of packages. Microsoft could potentially create their own one-stop-shop for Windows desktop programs. A company could manage its own repository with the programs they use so they can be easily installed and managed. A software developer could set up a repository containing only the software they create so their users can easily install and update it. You can add more repositories with the Add-PackageSource cmdlet or remove them with Remove-PackageSource.
The Find-Package cmdlet lets you search the package sources you’ve configured for available packages. Find software to install without searching the web!
The Install-Package cmdlet then lets you install a package of your choice, just by specifying its name. The package is automatically downloaded and installed from the software repository of your choice without any searching for .exe files, downloading them, and clicking through wizards that try to install junk on your computer. Better yet, you can specify multiple package names here — imagine installing the fifty Windows programs you use with a single command and leaving your computer to get a coffee while doing so.
The Get-Package cmdlet then lets you see what packages you have installed. Packages can later be uninstalled with Uninstall-Package. There’s currently no Update-Package command that will automatically install the latest versions of these software package from the available repositories, something that will be sorely needed — hopefully it’s on its way.
What’s a Package Manager? And What’s Chocolatey?
RELATED:How Software Installation & Package Managers Work On Linux
If you’ve gotten this far, you should understand the basics of what a package manager is. Basically, it’s a software tool that makes installation, updating, and locating of software to install much easier. Package managers are used on Linux, and they let you install packages from trusted software repositories in just a few clicks or keystrokes. The package manager can automatically update your packages whenever updated versions are added to the repositories, so every program doesn’t need its own built-in updater. It’s easy to use, and also very easy to automate.
RELATED:How to Bring Linux-Style apt-get Installations to Windows with Chocolatey
Chocolatey is a package manager that brings this style of easy software installation to Windows. Currently, it primarily uses text commands so it hasn’t found much of a home beyond geeks — but geeks love it! Chocolatey allows you to install Windows software like Firefox, VLC, and 7-Zip with just a few keystrokes instead of the usual downloading and clicking process, just like you’d install software on Linux. Chocolatey is currently running a Kickstarter, seeking money to “take Chocolatey to the next level.” They’re also working on a graphical user interface for their package manager so average Windows users can more easily use it. With the package manager framework in Windows 10, Chocolatey can easily piggy-back off whatever work Microsoft is doing — work that seems originally inspired by Chocolatey. Rather than being a bolted-on package management system, Chocolatey will work hand-in-hand with the package management framework included with Windows.
It’s impossible to say exactly how far Microsoft will go here. One thing’s for sure: For Windows system administrators and geeks, installing software and automating software deployments is about to get a lot easier. This is currently a geek tool, as it’s only available via PowerShell commands. But, as Microsoft says, this will eventually be exposed as a set of APIs.
Microsoft could do a lot more with this. They could use this package management system to add easy installation of desktop applications from the Windows Store — we already know they’re going to add desktop applications to the Windows Store in Windows 10. On Linux systems, there are nice graphical “app store”-style interfaces that make installing desktop programs from the system package manager easy. We’ll have to keep watching Windows 10 and see just how far they take this new package management framework. Play store free download apk.
Most Windows users don’t pay much attention to how desktop programs are installed on their system. For years we’ve been trained to seek out a website, download an EXE or MSI file, and then click, click, click our way through the installation.
It’s an easy method, but it’s also time consuming because of the manual interaction.
A burgeoning project called Chocolatey wants to make it easy to install desktop apps without having to click through an interminable number of installation windows.
What is Chocolatey?
Chocolatey is a command line application installer for Windows based on a developer-centric package manager called NuGet. Unlike manual installations, Chocolatey adds, updates, and uninstalls programs in the background requiring very little user interaction. 300mb movies download.
Chocolatey has its own package feed that is created and maintained by the project’s community members.
Behind the scenes, most Chocolatey packages simply download a program’s official executable and install it without any further interaction from the user.
You lost me at “command line”
Chocolatey Package List
No, wait, hear me out!
Getting new programs the old fashioned way is very easy, but manual installs are also inefficient. Wouldn’t you rather spend your time checking out the latest cat videos on YouTube while your PC goes about installing programs by itself?
That’s the promise of Chocolatey. If the program has any dependencies, such as the .NET framework, Chocolatey will install those too.
Chocolatey can also take care of multiple program installations.
Imagine cracking open a new PC, downloading Chocolatey and then typing a one-line command to install all the programs you’d like to have on your new machine. That's what Chocolatey does.
Installing Chocolatey
Getting Chocolatey onto your system is very simple since the commands can be copied and pasted into your command prompt from Chocolatey.org. To start, you need to open an elevated command prompt.
Chocolatey Package Management
To do this in Windows 8.1, click on the Start button and go to the all apps screen. Under the Windows System heading find Command Prompt, right click-it and select Run as administrator. When the User Account Control window opens, authorize it by clicking Yes.
A command prompt window should open with something like C:WINDOWSsystem32.
Next, visit Chocolatey.org and copy the first box. At this writing, the commands were:
Paste it into the prompt, press Enter and your PC will take care of the rest.
Usually doing a copy and paste of commands is not advisable, but in this case it’s just fine.
So you can rest easier, let’s break the instructions down a little bit: These commands are telling your PC to launch PowerShell and don’t load any custom profiles a power user might have. Next, it tells Windows to set the execution policy to unrestricted to allow any PowerShell script to be run and then download and run the Chocolatey install script.
Chocolatey basics
Installing programs Chocolatey style
Once you’ve got Chocolatey up and running, it’s time to start installing programs. Open an administrative command prompt again and type cinst [program name]
.
If you wanted to install VLC you’d type:
Pretty easy, right? The trick is that you need to know the exact name Chocolatey uses for each program. You can’t just type Chrome
or Google-Chrome
and expect Chocolatey to figure it out.
To find the names of programs, you can try playing around on the command line with the trial and error method (which works more often than you’d think). If you don't have that kind of time, search Chocolatey.org’s online package catalog for programs. You can also search for packages right on the command line:
Multiple installs
There are two ways to install multiple programs in one sitting with Chocolatey. The first is to type multiple arguments into the command line. If you wanted to install VLC, GIMP, and Firefox you’d type:
For much larger batches of programs, however, you’re better off creating an XML document with a .config file extension and formatting it like so:
That basic document structure can include as many programs as you like, and can even include alternative sources other than Chocolatey’s community feed. For a more thorough tutorial on creating a multiple install file, check out developerFusion.
Uninstalling and updating
Remove Chocolatey Package Manager
Updating installed programs via Chocolatey is simple too. Type cup [program name]
into an administrative command. To update DosBox, for example, type:
You can also update all your programs by typing cup all
. If your package is using an alternative source other than the main Chocolatey package feed, you can type:
Uninstalling a package is a little different. Going back to our example, you'd type the following to uninstall DosBox:
On the next page, we'll cover standardized commands and security concerns.