Uninstall Chocolatey package
Asked Answered
C

2

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?

Cohbath answered 1/5, 2012 at 18:17 Comment(1)
foe those who end up here, the correct command now is choco uninstall PackageNameValuer
B
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.

Ballarat answered 2/7, 2012 at 10:24 Comment(5)
this is the correct way to uninstall anything from chocolateySymbolics
Uninstall-ChocolateyPackage.ps1 & UnInstall-ChocolateyZipPackage.ps1 are now provided within %chocolateyinstall%\helpers\functions (at least in v>=0.9.8.20). You could <requires> this version of chocolatey or review the trunk and determine which version contains both helper functions.Inexertion
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 and/or Helpers Reference.Inexertion
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.Rightminded
It's now choco uninstall packagename (cinst is going soon)Sauls
M
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)
Milreis answered 11/5, 2012 at 23:31 Comment(3)
regarding your last point, it's actually possible via: >chocolatey uninstall nunit -version 2.5.7.10213 Source: github.com/chocolatey/chocolatey/wiki/CommandsUninstall/…Drawknife
Uninstall command currently ignores the version argument and defaults to the latest version (see github.com/chocolatey/chocolatey/wiki/CommandsUninstall), so there is no possibility to uninstall specific version.Kirbie
Most of these comments have been addressed. chocolatey.org/docs/commands-uninstall is the updated link for this now.Blende

© 2022 - 2024 — McMap. All rights reserved.