The Chocolatey Package Manager (A package-management system for windows)
What is a Package Manager?
A package manager is a command-line tool that is used to install software (termed packages) onto your local machine. Unlike most windows users who have to go through the hustle of getting the software’s installation setup and then run in order to install, package managers just allow you to run a single command in the terminal, and afterwards your software is being downloaded and installed on your local machine. Here, you can uninstall your software from your machine in-case you don’t need it anymore or even upgrade your software with just a single command in your terminal.
The software or programs managed by the package manager are mostly called Packages.
What is Chocolatey?
Chocolatey is a command-line and graphical-user interface package manager for windows that enables windows users to install, uninstall, configure or modify packages or software through the terminal(command prompt, cmder etc.) and also through it graphical software. Despite the fact that there is also a GUI version of chocolatey, we will focus on the CLI version in this article.
Since most of computer users are used to the Graphical-User Interface which is the most preferred way of life in computing nowadays, one may ask, Why do I have to use the command-line if I can just do most task with graphical-interface?. Well, the factor here is time. Why do you have to waste time doing all the click! click!! click!!! when you can just install the same package/software (say vlc) with just a simple command phrase like choco install vlc and chocolatey which is our package manager in this case will just commence installation for vlc while you do other task on your machine. Crazy right! Well that is the super power of command-line interface.
So in this article our focus is going to be geared towards the usage of the chocolatey package manager with the command line interface.
We are going to install chocolatey using the Terminal (cmder terminal). If you don’t have a suitable terminal like cmder on your windows or if you don’t know what a terminal is, click on the link below to read more about terminals and how to get one on your windows computer.
or watch the video below on how to download it and also get more insight about it
By now I believe you have your terminal up and running. If yes, follow the steps below.
- launch your terminal as an administrator
you can use command prompt for this process. But in this article, we are going to use the cmder terminal. In either case, just remember to run your terminal as an administrator else these steps won’t work
- After launching your terminal as an admin, copy the codes from the link below and paste it into your terminal.
- After pasting, press enter and your terminal will begin the installation. In the process of the installation, you may be asked to grant some permissions in order for the installation to proceed. Type y or yes to accept and press enter to proceed.
You can also watch the video below on how to get the chocolatey package manager
How to use Chocolatey?
I will assume that you have chocolatey installed on your computer. If you want to confirm that you have chocolatey installed on your machine, just type choco -v.
Okay. So now that chocolatey is up and running, lets dive in.
Chocolatey is a command line package manager with lots of commands. But in this article we are just going to focus on the major basic ones which are installing, upgrading and uninstalling packages.
Before proceeding from here, you must note that on the verge of installing, updating or removing packages with chocolatey, you may be required to grant some permissions to chocolatey to proceed with some processes. These permissions usually come with a yes (y) or no (n) demanded answers. To enable chocolatey to proceed with your request (installing, upgrading or uninstalling packages), just type yes or y and press enter
- Installing packages
To install packages with chocolatey, run the following commands.
choco install <package name>
e.g: choco install vscode
you can also install multiple packages at once by running
choco install <package name1> <package name2> <package name3>…
eg: choco install vscode vlc googlechrome
note that the multiple package names must be separated with spaces.
2. Updating / Upgrading packages
To update or upgrade packages with chocolatey, run the following commands.
choco upgrade <package name>
e.g: choco upgrade vscode
To upgrade multiple packages at once, run
choco upgrade <package name1> <package name2> <package name3>…
eg: choco upgrade vscode vlc googlechrom
you can also upgrade/update all chocolatey packages on your computer by just running
choco upgrade all
3. Uninstalling packages
To uninstall or remove a package from you computer or desktop, run
choco uninstall <package name>
e.g: choco uninstall vscode
you can also uninstall multiple packages at once by running
choco uninstall <package name1> <package name2> <package name3>…
eg: choco uninstall vscode vlc googlechrome
With the guidance of this brief article about the chocolatey package manager, you are good to go with chocolatey. But if you need reference to more commands, you can visit the chocolatey command reference page here ->https://chocolatey.org/docs/commands-reference#commands
© 2021 Marathintech inc