How to install chocolatey/choco on Windows 10

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 Install chocolatey/choco on Windows 10

  1. Click Start and type “powershell
  2. Right-click Windows Powershell and choose “Run as Administrator
  3. 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'))
  4. Answer Yes when prompted
  5. 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 [keyword]
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 [Approved] Downloads cached for licensed users
pcwrunas 0.4.0.20161129 [Approved] Downloads cached for licensed users
lightworks 14.0.0.20171007 [Approved]
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 [packagename]

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 [Approved]
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?([Y]es/[N]o/[P]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 [packagename]

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?([Y]es/[N]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 [Approved]
git 2.15.1 [Approved]
git 2.15.0 [Approved]
git 2.14.3 [Approved]
git 2.14.2.20170927 [Approved]
git 2.14.2 [Approved]
...
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

Amazon AWS too complex and expensive? You will love the simplicity of DigitalOcean. Deploy your next app in seconds. Get $100 in cloud credits from DigitalOcean

Ad Notice I will receive a small commission that helps support this blog at no cost to you.

8 Replies to “How to install chocolatey/choco on Windows 10”

  1. Thanks for this tutorial! I looked at Chocolatey as a way to make sure deployed software was up to date across our enterprise. At that time (maybe 2015?) it was too complicated and I settled for using Ninite instead. This has showed me how simple to use Chocolatey really is and I will definitely keep it in mind for future uses.

  2. Exception calling “DownloadString” with “1” argument(s): “The request was aborted: Could not create SSL/TLS secure
    channel.”
    At line:2 char:3
    + iex ((New-Object System.Net.WebClient).DownloadString(‘https://choc …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.