46

The Chocolatey package manager supports silent installations via the command below. It doesn't seem to have an uninstall command.

cinst install packagename

Is there a way to uninstall an application via Chocolatey?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Shaun Danielz
  • 571
  • 1
  • 4
  • 5

2 Answers2

53

As I answered here, you can use

cuninst packagename

to uninstall a package.

Details can be found at Uninstall Command.

Edit: For new versions, should use choco uninstall packagename.

Community
  • 1
  • 1
xuhdev
  • 8,018
  • 2
  • 41
  • 69
  • this is the correct way to uninstall anything from chocolatey – Sultan Saadat Feb 21 '13 at 09:56
  • `Uninstall-ChocolateyPackage.ps1` & `UnInstall-ChocolateyZipPackage.ps1` are now provided within `%chocolateyinstall%\helpers\functions` (at least in v>=0.9.8.20). You could `` this version of chocolatey or [review the trunk and determine which version contains both helper functions](https://github.com/chocolatey/chocolatey/commit/3cbdc56f8699e5d6fe8277cf950d8ab104eefad6#src/helpers/functions). – brandeded Sep 09 '13 at 15:57
  • Just spoke to Rob Reynolds in #chocolatey on freenode and he stated that these helper functions aren't ready for prime time yet, so avoid their use for a bit. When they are ready they will be listed here: [Contibute](http://chocolatey.github.io/contribute.html) and/or [Helpers Reference](https://github.com/chocolatey/chocolatey/wiki/HelpersReference). – brandeded Sep 09 '13 at 19:18
  • 1
    Yes but it does not work. It says done. But it did nothing eg for the nodejs.install package. It could at least say : I am sorry I cant do that. – Patrik Lindström Jun 29 '14 at 19:51
  • 1
    It's now `choco uninstall packagename` (cinst is going soon) – Chris S Jan 02 '16 at 22:22
18

Update: Chocolatey now has primitive support for uninstall through 'cuninst packagename'. With that though the package authors need to provide a chocolateyUninstall.ps1 file that would undo all of the things that the install did. It's limited because

  • There are no functions defined in the Chocolatey PowerShell module that would help with uninstall
  • There is no automatic removal of MSIs
  • Uninstall only removes the most current version of a package in the machine repository (instead of giving you options to remove a certain one or all of them)
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Matt
  • 5,052
  • 4
  • 36
  • 54
  • regarding your last point, it's actually possible via: >chocolatey uninstall nunit -version 2.5.7.10213 Source: https://github.com/chocolatey/chocolatey/wiki/CommandsUninstall/5b07bfce32d5069f8640883f69c2378481f10801#wiki-examples – Andre Miras Jan 31 '14 at 14:00
  • Uninstall command currently ignores the version argument and defaults to the latest version (see https://github.com/chocolatey/chocolatey/wiki/CommandsUninstall), so there is no possibility to uninstall specific version. – David Ferenczy Rogožan Nov 11 '14 at 15:58
  • Most of these comments have been addressed. https://chocolatey.org/docs/commands-uninstall is the updated link for this now. – ferventcoder Nov 08 '16 at 23:16