Uninstall Command (choco uninstall)

Uninstalls a package or a list of packages.

Chocolatey automatically tracks registry changes for "Programs and Features" of the underlying software's native installers when installing packages. The "Automatic Uninstaller" (auto uninstaller) service is a feature that can use that information to automatically determine how to uninstall these natively installed applications. This means that a package may not need an explicit chocolateyUninstall.ps1 to reverse the installation done in the install script.

Chocolatey tracks packages, which are the files in $env:ChocolateyInstall\lib\packagename. These packages may or may not contain the software (applications/tools) that each package represents. The software may actually be installed in Program Files (most native installers will install the software there) or elsewhere on the machine.

With auto uninstaller turned off, a chocolateyUninstall.ps1 is required to perform uninstall from the system. In the absence of chocolateyUninstall.ps1, choco uninstall only removes the package from Chocolatey but does not remove the software from your system (unless in the package directory).

:choco-info: NOTE

A package with a failing uninstall can be removed with the -n --skipautouninstaller flags. This will remove the package from chocolatey without attempting to uninstall the program.

:choco-info: NOTE

Chocolatey Pro / Business automatically synchronizes with Programs and Features, ensuring manually removed apps are automatically removed from Chocolatey's repository.

:choco-info: NOTE

Synchronizer and AutoUninstaller enhancements in licensed versions of Chocolatey ensure that Autouninstaller is up to 95% effective at removing software without an uninstall script. This is because synchronizer ensures the registry snapshot stays up to date and licensed enhancements have the ability to inspect more locations to determine how to automatically uninstall software.

Usage

choco uninstall <pkg|all> [pkg2 pkgN] [options/switches]

:choco-info: NOTE

all is a special package keyword that will allow you to uninstall all packages.

See It In Action

choco uninstall

Examples

choco uninstall git
choco uninstall notepadplusplus googlechrome atom 7zip
choco uninstall notepadplusplus googlechrome atom 7zip -dv
choco uninstall ruby --version 1.8.7.37402
choco uninstall nodejs.install --all-versions

:choco-info: NOTE

See scripting in how to pass arguments (choco -?) for how to write proper scripts and integrations.

Exit Codes

Exit codes that normally result from running this command.

Normal:

  • 0: operation was successful, no issues detected
  • -1 or 1: an error has occurred

Package Exit Codes:

  • 1605: software is not installed
  • 1614: product is uninstalled
  • 1641: success, reboot initiated
  • 3010: success, reboot required
  • other (not listed): likely an error has occurred

In addition to normal exit codes, packages are allowed to exit with their own codes when the feature 'usePackageExitCodes' is turned on.

Reboot Exit Codes:

  • 350: pending reboot detected, no action has occurred
  • 1604: install suspended, incomplete

In addition to the above exit codes, you may also see reboot exit codes when the feature 'exitOnRebootDetected' is turned on. It typically requires the feature 'usePackageExitCodes' to also be turned on to work properly.

Options and Switches

:choco-info: NOTE

Options and switches apply to all items passed, so if you are running a command like install that allows installing multiple packages, and you use --version=1.0.0, it is going to look for and try to install version 1.0.0 of every package passed. So please split out multiple package calls when wanting to pass specific options.

Includes default options/switches (included below for completeness).




 -?, --help, -h
     Prints out the help menu.

     --online
     Online - Open help for specified command in default browser application. 
       This option only works when used in combintation with the -?/--help/-h 
       option.  Available in 2.0.0+

 -d, --debug
     Debug - Show debug messaging.

 -v, --verbose
     Verbose - Show verbose messaging. Very verbose messaging, avoid using 
       under normal circumstances.

     --trace
     Trace - Show trace messaging. Very, very verbose trace messaging. Avoid 
       except when needing super low-level .NET Framework debugging.

     --nocolor, --no-color
     No Color - Do not show colorization in logging output. This overrides 
       the feature 'logWithoutColor', set to 'False'.

     --acceptlicense, --accept-license
     AcceptLicense - Accept license dialogs automatically. Reserved for 
       future use.

 -y, --yes, --confirm
     Confirm all prompts - Chooses affirmative answer instead of prompting. 
       Implies --accept-license

 -f, --force
     Force - force the behavior. Do not use force during normal operation - 
       it subverts some of the smart behavior for commands.

     --noop, --whatif, --what-if
     NoOp / WhatIf - Don't actually do anything.

 -r, --limitoutput, --limit-output
     LimitOutput - Limit the output to essential information

     --timeout, --execution-timeout=VALUE
     CommandExecutionTimeout (in seconds) - The time to allow a command to 
       finish before timing out. Overrides the default execution timeout in the 
       configuration of 2700 seconds. Supply '0' to disable the timeout.

 -c, --cache, --cachelocation, --cache-location=VALUE
     CacheLocation - Location for download cache, defaults to %TEMP% or value 
       in chocolatey.config file.

     --allowunofficial, --allow-unofficial, --allowunofficialbuild, --allow-unofficial-build
     AllowUnofficialBuild - When not using the official build you must set 
       this flag for choco to continue.

     --failstderr, --failonstderr, --fail-on-stderr, --fail-on-standard-error, --fail-on-error-output
     FailOnStandardError - Fail on standard error output (stderr), typically 
       received when running external commands during install providers. This 
       overrides the feature failOnStandardError.

     --use-system-powershell
     UseSystemPowerShell - Execute PowerShell using an external process 
       instead of the built-in PowerShell host. Should only be used when 
       internal host is failing.

     --no-progress
     Do Not Show Progress - Do not show download progress percentages.

     --proxy=VALUE
     Proxy Location - Explicit proxy location. Overrides the default proxy 
       location of ''.

     --proxy-user=VALUE
     Proxy User Name - Explicit proxy user (optional). Requires explicit 
       proxy (`--proxy` or config setting). Overrides the default proxy user of 
       ''.

     --proxy-password=VALUE
     Proxy Password - Explicit proxy password (optional) to be used with 
       username. Requires explicit proxy (`--proxy` or config setting) and user 
       name.  Overrides the default proxy password (encrypted in settings if 
       set).

     --proxy-bypass-list=VALUE
     ProxyBypassList - Comma separated list of regex locations to bypass on 
       proxy. Requires explicit proxy (`--proxy` or config setting). Overrides 
       the default proxy bypass list of ''.

     --proxy-bypass-on-local
     Proxy Bypass On Local - Bypass proxy for local connections. Requires 
       explicit proxy (`--proxy` or config setting). Overrides the default 
       proxy bypass on local setting of 'True'.

     --log-file=VALUE
     Log File to output to in addition to regular loggers.

     --skipcompatibilitychecks, --skip-compatibility-checks
     SkipCompatibilityChecks - Prevent warnings being shown before and after 
       command execution when a runtime compatibility problem is found between 
       the version of Chocolatey and the Chocolatey Licensed Extension. 
       Available in 1.1.0+

     --ignore-http-cache
     IgnoreHttpCache - Ignore any HTTP caches that have previously been 
       created when querying sources, and create new caches. Available in 2.1.0+

 -s, --source=VALUE
     Source - The source to find the package(s) to install. Special sources 
       include: ruby, cygwin, windowsfeatures, and python. Defaults to default 
       feeds.

     --version=VALUE
     Version - A specific version to uninstall. Defaults to unspecified.

 -a, --allversions, --all-versions
     AllVersions - Uninstall all versions? Defaults to false.

     --ua, --uninstallargs, --uninstallarguments, --uninstall-arguments=VALUE
     UninstallArguments - Uninstall Arguments to pass to the native installer 
       in the package. Defaults to unspecified.

 -o, --override, --overrideargs, --overridearguments, --override-arguments
     OverrideArguments - Should uninstall arguments be used exclusively 
       without appending to current package passed arguments? Defaults to false.

     --notsilent, --not-silent
     NotSilent - Do not uninstall this silently. Defaults to false.

     --params, --parameters, --pkgparameters, --packageparameters, --package-parameters=VALUE
     PackageParameters - Parameters to pass to the package. Defaults to 
       unspecified.

     --argsglobal, --args-global, --installargsglobal, --install-args-global, --applyargstodependencies, --apply-args-to-dependencies, --apply-install-arguments-to-dependencies
     Apply Install Arguments To Dependencies  - Should install arguments be 
       applied to dependent packages? Defaults to false.

     --paramsglobal, --params-global, --packageparametersglobal, --package-parameters-global, --applyparamstodependencies, --apply-params-to-dependencies, --apply-package-parameters-to-dependencies
     Apply Package Parameters To Dependencies  - Should package parameters be 
       applied to dependent packages? Defaults to false.

 -x, --forcedependencies, --force-dependencies, --removedependencies, --remove-dependencies
     RemoveDependencies - Uninstall dependencies when uninstalling package(s-
       ). Defaults to false.

 -n, --skippowershell, --skip-powershell, --skipscripts, --skip-scripts, --skip-automation-scripts
     Skip PowerShell - Do not run chocolateyUninstall.ps1. Defaults to false.

     --ignorepackagecodes, --ignorepackageexitcodes, --ignore-package-codes, --ignore-package-exit-codes
     IgnorePackageExitCodes - Exit with a 0 for success and 1 for non-succes-
       s, no matter what package scripts provide for exit codes. Overrides the 
       default feature 'usePackageExitCodes' set to 'True'.

     --usepackagecodes, --usepackageexitcodes, --use-package-codes, --use-package-exit-codes
     UsePackageExitCodes - Package scripts can provide exit codes. Use those 
       for choco's exit code when non-zero (this value can come from a 
       dependency package). Chocolatey defines valid exit codes as 0, 1605, 
       1614, 1641, 3010. Overrides the default feature 'usePackageExitCodes' 
       set to 'True'.

     --autouninstaller, --use-autouninstaller
     UseAutoUninstaller - Use auto uninstaller service when uninstalling. 
       Overrides the default feature 'autoUninstaller' set to 'True'.

     --skipautouninstaller, --skip-autouninstaller
     SkipAutoUninstaller - Skip auto uninstaller service when uninstalling. 
       Overrides the default feature 'autoUninstaller' set to 'True'.

     --failonautouninstaller, --fail-on-autouninstaller
     FailOnAutoUninstaller - Fail the package uninstall if the auto 
       uninstaller reports and error. Overrides the default feature 
       'failOnAutoUninstaller' set to 'False'.

     --ignoreautouninstallerfailure, --ignore-autouninstaller-failure
     Ignore Auto Uninstaller Failure - Do not fail the package if auto 
       uninstaller reports an error. Overrides the default feature 
       'failOnAutoUninstaller' set to 'False'.

     --stoponfirstfailure, --stop-on-first-failure, --stop-on-first-package-failure
     Stop On First Package Failure - stop running install, upgrade or 
       uninstall on first package failure instead of continuing with others. 
       Overrides the default feature 'stopOnFirstPackageFailure' set to 'False'.

     --exitwhenrebootdetected, --exit-when-reboot-detected
     Exit When Reboot Detected - Stop running install, upgrade, or uninstall 
       when a reboot request is detected. Requires 'usePackageExitCodes' 
       feature to be turned on. Will exit with either 350 or 1604.  Overrides 
       the default feature 'exitOnRebootDetected' set to 'False'.

     --ignoredetectedreboot, --ignore-detected-reboot
     Ignore Detected Reboot - Ignore any detected reboots if found. Overrides 
       the default feature 'exitOnRebootDetected' set to 'False'.

     --skiphooks, --skip-hooks
     Skip hooks - Do not run hook scripts. Available in 1.2.0+

     --fromprograms, --from-programs, --fromprogramsandfeatures, --from-programs-and-features
     From Programs and Features - Uninstalls a program from programs and 
       features. Name used for id must be a match or a wildcard (*) to Display 
       Name in Programs and Features. Available in [licensed editions](https://chocolatey.org/compare) only.

     --use-self-service, --force-self-service
     Force the command to be handled through the self-service when not 
       configured to allow this command. This option requires the features for 
       self-service and self-service command override to be enabled. Business 
       editions only (licensed version 5.0.0+).

Command Reference

:choco-info: NOTE

This documentation has been automatically generated from choco uninstall -h.