As a Windows user with Linux knowledge there are several things under Linux that I would like to have on for Windows. Since a complete switch from Windows to Linux is not feasible for me due to different requirements, I looked for alternatives. An important component of various Linux distributions is their package manager. This article discusses the implementation of such a feature under Windows and shows how it can be used.

While researching this topic I came across chocolatey, a CLI-tool that acts as package manager for Windows operating systems. Chocolatey is open source, the code is available on GitHub. On the project’s website you will also find instructions for installation, which can be performed using CMD commands or via powershell.

Install, Update, Uninstall

A list of available packages can be viewed on https://chocolatey.org/packages. As with the Arch User Repository, packages are managed by users, which means that there is a very large selection of available packages. The pattern for installing packages is

choco install

A full list of commands can be found in the docs. Installed packages can be uninstalled using

choco uninstall

or upgraded by using

choco upgrade

If you want to upgrade all installed packages, simply use the keyword all instead of a specific packagename.

By default, Chocolatey creates a directory under C: \ProgramData which contains the program files. The installation locations for the individual programs depend on the configuration of the package, but usually either C:\Program Files or C:\Program Files (x86) is used.

Further Commands

Of course, the package management does not only include installation, upgrade and deinstallation of packages, so this section is dedicated to some other features. Check out the docs for a complete list of features.

You can search packages by using

choco search

which results into something similar to the following listing.

1
2
3
4
5
6
7
D:\>choco search jenkins
Chocolatey v0.10.8
jenkins 2.60.3 [Approved]
gradle 4.1.0 [Approved] Downloads cached for licensed users
notify-me-ci 1.3.3.13 [Approved] Downloads cached for licensed users
JenkinsOnDesktop 1.0
4 packages found.

To check out the installed version of choco, you can use

choco –version

or

choco -v

To upgrade chocolatey, just use the regular update command. To list all packages available, use

choco list

If you only want to receive the packages that are installed locally, add the -l flag.

These few commands should be sufficient to enable you to get started with package management under Windows. As already mentioned, the documentation of the project conveys all further details in a simple and understandable way. And, if you’re not comfortable using the command line, there is also a graphical user interface for chocolatey available, which can be found under the name chocolateygui.