Chocolatey is a Windows package manager that lets you quickly install new software or prep a new Windows 10 installations with your favorite applications, all from the command line.
If you are a Linux user, package managers such as ‘apt’ or ‘rpm’ are familiar tools used to install Linux programs and resolve any required dependencies. Over the past few years, package managers have also gained popularity in Windows 10.
The most popular Windows package manager is Chocolatey, which is designed for both consumers (general users) and businesses and offers an easy to understand user interface and a suite of powerful features for deploying programs.
To use Chocolatey, your system needs the following system requirements:
@"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
If you don’t see any error after entering the above command, Chocolatey is ready for use. In some cases, you’ll be asked to restart the shell. To do this, close the Command Prompt window and relaunch it.
Also Read: How To Prevent WhatsApp Hack: 7 Best Practices
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
When done correctly, you will now have access to the choco or choco -? command.
Like every other package manager, Chocolatey is entirely a command-line tool where you have to type in the commands you wish to execute.
After installing Chocolatey, launch a Command Prompt or PowerShell and type ‘choco -?
‘ to get a list of commands that you can run.
These commands are listed below:
To see help for each command, you can enter choco [command] -help
. For example, to get help on the list command, you can type choco list help
.
Also Read: 15 Best Tools For Your Windows 10 Privacy Settings Setup
The purpose of a package manager is to be able to easily install applications in Windows. To find a list of available applications to install you can use the choco list [search_keyword]
command.
For example, if you want to see if Notepad++ is available as a package, you can open a Command Prompt or PowerShell console with admin rights and enter choco list notepad++
.
Chocolatey will now search for available packages associated with this name and list them, as shown below.
To install apps using Chocolatey, you have to use choco install
command and follow it with the supported package name.
In the example below, we’re using Chocolatey to install Notepad++ by entering the choco install notepadplusplus
command.
Chocolatey will now download and install the program on your computer. When installing the program, you may be prompted to run various scripts to finish the installation, which should be allowed.
It is also possible to install multiple apps at the same time by separating them by spaces. For example, to install Notepad++ and 010Editor at the same time, you would use the following command:
choco install notepadplusplus 010editor
To keep programs updated, you can routinely enter the following command to check for new versions of install packages and update them.
choco outdated
Just like you can install Windows 10 applications with Chocolatey, you can also uninstall them with the choco uninstall [package]
command.
For example, to uninstall the Notepad++ application, you can enter the choco uninstall notepadplusplus
command.
Chocolatey is commonly updated with new features and bug fixes, so it is essential to keep it updated with the latest version.
The update can be done via the command line using the “upgrade” command:
choco upgrade chocolatey
Fortunately, Chocolatey also allows you to change the default installation directory, so that you can install the program in the location of your choice.
For MSI-based installers, you can use the command -ia "INSTALLDIR=""D:Program Files"""
in cmd.exe
If you want simpler and greater control over the directory, you must have a licensed edition of Chocolatey (Pro and/or Business).
If you have the licensed editor, you can use the --install-directory=value
command to change the directory where an application is installed.
If you don’t like Chocolatey for whatever reason, you can uninstall it by following these steps:
C:ProgramDatachocolatey
If you’re unable to find the installation path, use command $env:ChocolateyInstall