Mindfulness

Chocolatey Commands Cheat Sheet

Updated · By the Relaxmid editors

Reading time
4 min
Sections
10
Topic
Mindfulness

Quick answer: The core Chocolatey commands are choco install, choco upgrade, choco uninstall, choco list, and choco search. Remember the golden rule: always run your command prompt as Administrator when installing or upgrading packages.

What Are the Most Used Chocolatey Commands?

Chocolatey is a package manager for Windows. You use it from the command line (PowerShell or Command Prompt). Here are the commands you will type most often:

  • choco install <package> – installs a package, for example choco install googlechrome.
  • choco upgrade <package> – updates an installed package to the latest version.
  • choco uninstall <package> – removes a package.
  • choco list – shows all packages installed on your machine.
  • choco search <keyword> – searches the community repository for available packages.
  • choco upgrade all – updates every installed package at once.

You can combine these with flags like -y to skip confirmation prompts. For example, choco install firefox -y installs Firefox without asking.

How Do I Install a Package with Chocolatey?

Open your command prompt as Administrator. Then type:

  1. choco install <package-name>
  2. Press Enter. Chocolatey will download and install the software.
  3. If you want to avoid the “Do you want to run the script?” prompt, add -y.

For example, to install Visual Studio Code: choco install vscode -y.

If you are not sure of the exact package name, use choco search first. For instance, choco search vscode lists all packages with “vscode” in the name.

How Do I Update or Remove Packages?

Updating is as simple as installing. Use:

  • choco upgrade <package> – updates one package.
  • choco upgrade all – updates everything installed via Chocolatey.

To remove a package, use choco uninstall <package>. For example, choco uninstall vscode uninstalls Visual Studio Code.

Note that Chocolatey only manages software it installed. If you installed a program manually, Chocolatey cannot uninstall it.

Where Do People Go Wrong with Chocolatey?

The most common mistake is not running the command prompt as Administrator. Without admin rights, Chocolatey cannot install or upgrade system-wide software. You will see an error like “Access denied” or a prompt to run as administrator.

Another mistake is confusing choco list with choco search. choco list shows what is installed on your machine. choco search looks through the online repository for packages you could install.

People also forget that some packages require a restart after installation. Chocolatey will usually tell you if a reboot is needed. It is safe to restart after a batch of installs.

Finally, be careful with choco upgrade all. It updates every package, which is convenient, but it can take a while and may require a reboot. If you only need one update, upgrade that single package instead.

How Do I See What Is Installed and Check for Updates?

To see everything Chocolatey has installed, run:

choco list

This shows package names and version numbers. To check if a specific package has an update, run:

choco outdated

This lists packages that are not at the latest version. Then you can upgrade them individually or all at once.

If you want to see the version of a particular package, use choco list <package>. For example, choco list vscode shows the installed version of Visual Studio Code.

What Do the Flags and Options Mean?

Chocolatey commands accept flags that change behavior. The most useful ones are:

  • -y – confirms all prompts automatically.
  • --version=X.Y.Z – installs a specific version, for example choco install python --version=3.11.0.
  • --source – specifies a different repository. Default is the community repository.
  • --force – reinstall or re-upgrade even if already at latest.
  • --params – passes parameters to the installer, like choco install notepadplusplus --params '/NoShortcut'.

You can see the full help for any command by typing choco install -? or choco upgrade -?. The help text explains each flag.

How Do I Export or Back Up My List of Packages?

To save a list of installed packages to a file, run:

choco list -r > packages.txt

The -r flag makes the output raw (just names and versions), which is easier to read later. The file packages.txt will be created in the current folder.

To reinstall those packages on a new machine, you can loop through the file. A simple way is to open the file and run choco install <package> for each line. Or you can use choco install <package> -y in a batch script.

This is handy when setting up a new computer or restoring after a system reset.

What Should I Do If a Command Fails?

First, check that you are running as Administrator. Then check your internet connection. Chocolatey needs to download packages from the repository.

If you get an error about a package not being found, double-check the package name. Use choco search <keyword> to find the exact name.

If an installation fails partway, you can try choco install <package> --force to reinstall. Sometimes a previous failed attempt leaves a lock file. Restarting the command prompt often clears it.

For persistent issues, look at the log file. Chocolatey writes logs to C:\ProgramData\chocolatey\logs\. The latest log is named choco.log. Open it to see the detailed error.

Can I Use Chocolatey for Everything?

Chocolatey works well for many common applications, but not all software is available. Some programs are not packaged for Chocolatey. For those, you still need to download and install manually.

Also, Chocolatey installs software system-wide, so you need admin rights. If you are on a work computer without admin access, Chocolatey may not work at all.

For personal use, Chocolatey is a convenient way to keep software updated from the command line. It saves time when setting up a new machine.

Remember to run choco upgrade all occasionally to keep everything current. That is the main maintenance task.

Related

General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more

Spotted an error? Tell us and we will correct it (corrections policy).