Linux distributions have different package managers like apt, yum, dnf in order to install applications, programs, packages. Windows recently has a package manager named Chocolatey
which can search, install, remove Windows packages from a decentralized repository. It uses the NuGet infrastructure using PowerShell.
Chocolatey Features
Chocolatey provides advanced features like below.
- Chocolatey provides an unattended installation with a PowerShell.
- Chocolatey works all existing software installation technologies like MSI, NSIS, InnoSeyup, etc.
- Chocolatey can manage all aspects of software like search, install, update, remove.
- With PowerShell, software management can be automated by supporting complex scenarios.
- Easily build software installation packages.
- With Packet Internalizer makes offline package installation.
- Chocolatey integrates with configuration managers like SCCM, Puppet, Chef, or PowerShell DSC.
- Create an internal organization repository for application installation.
- Provides CLI tool named, choco.exe for command-line usage.
- Provide a GUI tool named Chocolatey GUI for human-friendly usage.
Chocolatey Installation Requirements
Chocolatey can be used with PowerShell and .Net Framework there is the following requirements in order to use Chocolatey.
- Windows 7+/Windows 2003+ (Server Core also, but not Windows Nano Server)
- Windows PowerShell v2+ (not PowerShell Core aka PowerShell 6 yet)
- .NET Framework 4.x+
Install Chocolatey On Windows with MS-DOS Command-line
We can install Chocolatey
from the MS-DOS command line. First, we will open the MS-DOS command line with Administrative privileges below. Click open Start Menu
and write cmd
which will list Command Prompt
. Right-click to the Command prompt which will open a menu which contains Run as administrator
like below and click to open it.

Then there will be a User Account Control. We will click to Yes

We will use the following command which is a bit complex but do not worry it will work seamlessly.
> @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Install Chocolatey On Windows with PowerShell Command-line
We can install Chocolatey
from the PowerShell command line. First, we will open the PowerShell command line with Administrative privileges below. Click open Start Menu and write cmd which will list Command Prompt. Right-click to the Command prompt which will open a menu which contains Run as administrator
like below and click to open it.

Then there will be a User Account Control. We will click to Yes

We will use the following command which is a bit complex but does not worry it will work seamlessly. Then we will enable the unsigned PowerShell scripts to run on PowerShell. We will use Set-ExecutionPolicy
. There will be a prompt where we will accept with A
.
PS> Set-ExecutionPolicy AllSigned

Now we can run the PowerShell installation script like below.
PS> Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Print Chocolatey Version
After installing the Chocolatey
we will print the version we have installed. We will use -v
option which will print only the version of choco.exe
.
PS> choco.exe -v

Print Chocolatey Help Information
We can print help information about the choco.exe
with the -h
option. This will simply print general commands and detailed usage information about the choco.exe
.
PS> choco.exe -h

Search Packages, Programs with Chocolatey
We will start with a searching specific package with the search
command. In this example, we will search for the package named winamp
.
PS> choco.exe search winamp

We can see that related packages are listed with the following information. We can see that there are 9 results which matched with the term winamp
.
package name
is the exact name of the package likewinamp
.version
is the latest package version which is5.666
.package status
is the state of the package whether it is approved or not.
Print Information About Packages, Programs with Chocolatey
Before installation or if we are curious we can list detailed information about a package. We will use info
command by providing the exact name of the package which is winamp
in this example.
PS> choco.exe info winamp

We can see that there is detailed information about the package like below.
Title
is the official name of the package which isWinamp
.-
Published
is the date the package last time published. Package Testing Status
is the package test result and status whether it is working properly.Number of Download
is the total download number.Downloads for this version
is the download number for the listed version which is 3386.Package URL Chocolatey Package Source
is the source of the package URL location.Package Checksum
is the SHA512 package hash.Tags
are keywords describing the package like category.Software site
is the site of the publishing of the software.Software License
Summary
is very little description of the package.Description
is detailed information about the package.
Install Packages, Programs with Chocolatey
We can install specific a package with the install
command by providing the package name.
PS> choco.exe install winamp

We can see that Winamp installation is completed successfully after following steps.
- The license is accepted
- Package is downloaded
- Accept to run installation scripts
- Installation Result
Install Multiple Packages, Programs with Chocolatey
We can also install multiple packages or programs with a single install command by separating them with spaces. We will use install
command in order to install nmap, notepadplusplus and winamp like below.
PS> choco.exe install notepadplusplus nmap winamp

Update Specified Packages, Programs with Chocolatey
We can update specific packages with the upgrade
command. We will also specify the package named which is nmap
in this case.
PS> choco.exe upgrade nmap

List Outdated/Old Packages with Chocolatey
We can also list currently installed and outdated or old packages. We will use outdated
command like below.
PS> choco.exe outdated

While listing outdated packages the following information is provided.
Package name
Current version
is the currently installed an outdated version.Available Version
is the updated version available.Pinned
Remove/Uninstall Packages, Programs with Chocolatey
We can remove or uninstall the specified package. We will use uninstall
command like below. We will uninstall the package named uninstall
.
PS> choco.exe uninstall winamp

Update/Upgrade Chocolatey Itself
Chocolatey is updated regularly. We can update upgrade chocolatey with the following command.
PS> choco.exe install chocolatey
Install Chocolatey GUI onWindows
Chocolatey GUI is provided with the choco.exe
we will install it with the package named chocolateygui
.
PS> choco.exe install chocolateygui

Chocolatey GUI
We can open Chocolatey GUI from the Start menu like below.

As this is a package manager to install packages we required Administrative privileges

We will see the following dashboard which will provide most of the command line functions like install, update, remove.
