In this article will show how to install programs and packages from the Command Prompt/Power shell on Windows operating system using Chocolatey – The package manager for Windows
The Linux distributions come with a package manager, which is a powerful tool for most power users to install, update and remove packages, directly from the command line or terminal. While most users are not comfortable with the interface of the command line or Terminal on Linux distributions, it is undeniably a great tool, if you know how to use it. On the other hand, Windows users enjoy the graphical user interface to install, update and uninstall programs and packages, which isn’t unified for all the programs you use regularly. Even though it is easy to manage programs on Windows in the user-friendly GUI, you should keep a constant tab to prevent the installer from installing any malware or unnecessary programs.
Considering likes and dislikes for the Terminal and the GUI to be a relative aspect, the good side is, you can even install programs on your Windows computer using the command line, just the way you do it on Linux-based operating systems or Linux distributions. As Windows doesn’t have native support for installing programs directly from the Command Prompt, you will have to use third-party software to enable this feature on Windows. Don’t worry. It isn’t going to cost you an arm and a leg, nor it is going to be too challenging.
So without further delay, let’s get started with how you can start installing apps on Windows directly from the Command Prompt or PowerShell, whichever is convenient for you.
The minimum requirements to install Chocolatey package manager
- You should be running Windows 7 or Windows 2003 or any other later version of Windows along with PowerShell v2 or any later version to use Chocolatey.
- .NET Framework 4 or better should also be installed on your computer.
So that was all about the minimum requirements to run Chocolatey on your Windows computer.
Ways to install Chocolatey Packages on Windows
Using Command Prompt
Step 1: Open Command Prompt
Press ‘Win + R’ and type ‘cmd’. Now press the key combination ‘Ctrl + Shift + Enter’ to open Command Prompt with administrator permissions.
Now type in the following command, and hit the enter key to execute the same.
@"%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"
Step 2: Download and install Chocolatey
Let Command Prompt download and install Chocolatey for you. You will get the following screen, and once the installation is complete, you can get back the prompt to enter the subsequent commands.
#Using Windows PowerShell to install Chocolatey
Step 1: Using PowerShell
Open Windows PowerShell with administrator rights by right-clicking on the Start menu and by clicking on ‘Windows PowerShell (Admin)’.
Now type in the following command to install Chocolatey using Windows PowerShell.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Wait for the download and installation process to be complete, and once it is complete, you can get back the prompt to enter a command and carry out your work.
The installation of Chocolatey using Command Prompt or Windows PowerShell is complete now.
I would recommend you to restart your computer before you carry out any real activity using Chocolatey.
Now open Command Prompt, and you can search for, install, update, and uninstall programs directly from the Command Prompt.
Some useful Chocolatey commands
Let’s find out some useful commands that can be handy for you while you are using Chocolatey. The commands aren’t platformed specific, and you can use the command on both Command Prompt and Windows PowerShell. But make sure, you are executing the commands with the administrator privileges.
- Getting help: choco -?
- Searching for programs: choco search <app/package_name>
- Installing programs: choco install <app/package_name>
- Updating programs: choco update <app/package_name>
- Uninstalling programs: choco uninstall <app/package_name>
- Updating Chocolatey: choco update chocolatey
There are hundreds of command available for Choco, and you can even use additional arguments with all the commands, however, you will not need to add extra arguments for if you are using it for personal usage. It can also be a tough job to remember the arguments, so nevermind. But if your friends call you a geek, and you are a confident power user, the extra arguments can surely come in handy once in a while. Here are the additional commands to use Chocolatey.
How to use Chocolatey command to download software packages
Chocolatey is super easy to use. Just search for the program, and install it effortlessly with just the command. So let me search for Vivaldi browser, and install it on my system.
Type the following command to search for the keyword Vivaldi, in the packages, which Chocolatey has access to.
choco search vivaldi
Now you will have to install Vivaldi on your system using the ‘install’ command.
Type in the following command to install Vivaldi.
choco install vivaldi
It isn’t necessary to install the complete package name. Just type in the name of the program or package, and leave the rest to Chocolatey.
The installation will start immediately, and meanwhile, you will be asked, whether you want to execute the script to download and install Vivaldi. Just type in Y, N, P respectively followed by the enter key to allow execution, prevent execution, and print the script respectively.
Needless to say, you need to enter ‘Y’ for installing Vivaldi. You will get the following screen, as long as the download and installation process goes on.
Once the installation is complete, you will get back the prompt.
Vivaldi will now be automatically available on your desktop.
Just open it to start using Vivaldi, just the way you do it for other programs on Windows.
How To Upgrade Chocolatey
Just in Command Prompt or Power shell of the Windows 10/8/7 use the below-given command.
choco upgrade chocolatey
How to uninstall Chocolatey installed Packages
To uninstall Vivaldi now, just type in the following command followed by hitting the enter key.
choco uninstall vivaldi
Now you will have to choose the version of Vivaldi, which you want to uninstall. I want to uninstall all the versions of Vivaldi, and thus, I will choose 4, and hit the enter key.
You will again be asked, whether you want to execute the script. Just type ‘Y’ and hit the enter key to execute the script and delete Vivaldi.
Vivaldi will not be uninstalled from your system. Depending upon which program you are uninstalling, you might be asked for a GUI-based confirmation to uninstall the program. You might even use additional arguments to force uninstall programs, the provision for which, is also available on Chocolatey.
Chocolatey is undoubtedly a powerful tool to manage programs and packages effortlessly on Windows. There are hundreds of programs, which you can download and install, using Chocolatey. Chocolatey is a kind of repository just like Linux, where you can download all your programs with just a single command. However I will never compare the power of Chocolatey repository with the apt repository for Linux, as both are meant for two different platforms, and availability will undoubtedly vary on the two.platforms.
With Chocolatey, you will not even need to enter the full name of the package, which is cool, as well. I searched for some random less well-known programs, most users haven’t heard about and I was amazed to see some results turn up. I am sure, the database of programs will keep expanding in the coming days. Chocolatey can be considered as a command line alternative for Ninite on Windows, which can help you install multiple selected programs in one go.
Chocolatey is open-source, though there are personal and business editions available, and you can see their prices here. You will no longer have to worry about automatic updates slowing down your internet connection, your computer or both, as you can update the programs and packages whenever you want, directly from the Command Prompt.
How cool was that! I know you will thank me later for this. Hope the information was useful for you. Do you have any additional questions? Feel free to comment the same down below.
- How to install ADB on Windows 10,8, 7 and Linux, the easiest way
- Download & install npm and node.js packages on Windows 10/8/7
- How to install Gimp on Ubuntu via command terminal
- Tutorial Install and use Node.js http-server (Web server) via NPM
- How to proceed with the Python Canopy installation steps, on Windows and Linux?
- Install Node js on Ubuntu 19.04
- Install Grunt on Windows 10/8/7