· Windows  · 5 min read

How to install chocolatey/choco on Windows 10

In this article, I will show you how to install Chocolatey on Windows 10. Chocolatey is an easy-to-use Software Package Manager for Windows similar to apt on ubuntu/debian or brew on OSX. Steps to...

This post was originally published on jcutrer.com (WordPress) and has been migrated to the archive.

In this article, I will show you how to install Chocolatey on Windows 10. Chocolatey is an easy-to-use Software Package Manager for Windows similar to apt on ubuntu/debian or brew on OSX.

Steps to Install chocolatey/choco on Windows 10

  • Click Start and type “powershell
  • Right-click Windows Powershell and choose “Run as Administrator
  • Paste the following command into Powershell and press enter.
Set-ExecutionPolicy Bypass -Scope Process -Force; `
  iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  • Answer Yes when prompted
  • Close and reopen an elevated PowerShell window to start using choco

Choco is now installed and can be used from a PowerShell prompt or a regular command prompt windows to install many different software packages. Whichever one you use, just make sure you run choco from an elevated powershell/command prompt window.

Package Search with choco

choco search You can search the choco repository to see exactly what software chocolatey can install.

C:\>choco search hugo
Chocolatey v0.10.8
hugo 0.32.2  Downloads cached for licensed users
pcwrunas 0.4.0.20161129  Downloads cached for licensed users
lightworks 14.0.0.20171007 
3 packages found.

Passing in the -v flag will give you more detailed information about each package. choco search hugo -v

I commonly use choco to install & update Hugo and sometimes Python3. Hugo is a excellent Static Website Generator written Go. Let’s try installing it!

Install software with choco

choco install

C:\WINDOWS\system32>choco install hugo
Chocolatey v0.10.8
Installing the following packages:
hugo
By installing you accept licenses for the packages.
Progress: Downloading hugo 0.32.2... 100%
hugo v0.32.2 
hugo package files install completed. Performing other installation steps.
The package hugo wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?(es/o/rint): y
Downloading hugo 64 bit
...
 The install of hugo was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\hugo\tools'
Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Upgrade software with choco

choco upgrade

C:\>choco upgrade hugo
Chocolatey v0.10.8
Upgrading the following packages:
hugo
By upgrading you accept licenses for the packages.
hugo v0.32.2 is the latest version available based on your source(s).
Chocolatey upgraded 0/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Installing choco updates

choco upgrade chocolatey Choco can also upgrade itself.

C:\>choco upgrade chocolatey
Chocolatey v0.10.8
Chocolatey detected you are not running from an elevated command shell
 (cmd/powershell).

 You may experience errors - many functions/packages
 require admin rights. Only advanced users should run choco w/out an
 elevated shell. When you open the command shell, you should ensure
 that you do so with "Run as Administrator" selected. If you are
 attempting to use Chocolatey in a non-administrator setting, you
 must select a different location other than the default install
 location. See
 https://chocolatey.org/install#non-administrative-install for details.

 Do you want to continue?(es/o): Y

Upgrading the following packages:
chocolatey
By upgrading you accept licenses for the packages.
chocolatey v0.10.8 is the latest version available based on your source(s).

Chocolatey upgraded 0/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

List Packages installed by Choco

choco list --local-only

C:\>choco list --local-only
Chocolatey v0.10.8
7zip 16.4.0.20170506
chocolatey 0.10.8
chocolatey-core.extension 1.3.1
hugo 0.31.1
4 packages installed.

Advanced choco usage examples

Now that we have covered the basics, let’s look at some advanced choco examples.

choco install chrome --yes The -y, --yes switch will make choco install without asking you any questions. This is useful if you are using choco in a batch file or powershell script. choco search Git -ev The -v, --verbose switch will print detailed package information but the search keyword usually matches multiple packages and it all goes flying by. The -e, --exact flag will narrow down the output to one particular packgae. choco search Git -ea Adding the -a, --all switch will list all versions of a specific package.

C:\>choco search Git -ea
Chocolatey v0.10.8
git 2.15.1.2 
git 2.15.1 
git 2.15.0 
git 2.14.3 
git 2.14.2.20170927 
git 2.14.2 
...

choco search python --order-by-popularity The --order-by-popularity switch will sort the search results, most popular packages first.

More Useful Software to Install with choco

Here is a list of useful software that I use, they can all be installed using choco.

  • choco install chrome - Google Chrome Browser
  • choco install git - Git cli Client for Windows
  • choco install github - Official GUI-Based Git Client
  • choco install 7zip - Archive utility to compress/uncompress zip, tar, gz, bzip and other formats.
  • choco install SublimeText3 - An execellent markdown & source code editor.
  • choco install vlc - An open-source media player
  • choco install putty - An open-source SSH client
  • choco install keepass - An open-source Password Manager
  • choco install greenshot - My favorite screenshot utility for Windows
  • choco install imagemagick.app - A suite of cli tools for working with and converting images

Thanks for following along, I hope you enjoyed this guide. Installing software on Windows with choco is a breeze. You will never want to go back to the Next, Next, Next, Finish GUI-based software installers.

If you’ve enjoyed this article about Chocolatey, please take a moment to leave a comment below or share it on social media. - JCutrer

References

Share:

Comments are disabled (Giscus not yet configured).

Back to archive