13

Is it safe to uninstall Chocolatey after I have installed applications with it?

I want to set up software for new PCs using Chocolatey, but want to remove the C:\Chocolatey folder. As far as I understand Chocolatey uses the native installers, so the programs appear in "Add and remove programs" of Windows and can be maintained that way. Chocolatey seems not needed any more by the user.

8

As a general rule of thumb, yes, it is "safe" to uninstall Chocolatey. Chocolatey, for the most part, is simply a wrapper around the native EXE/MSI for the application that is being installed. As a result, removing Chocolatey, does not remove the installed applications.

There are some types of Applications, for instance, Command Line/Portable ones, that will have an adverse effect by removing Chocolatey, so you may want to take some care here. For instance, when installing say GitVersion.Portable, Chocolatey adds a "shortcut" to the resulting EXE in the Chocolatey bin folder (which is on the system path). By uninstalling Chocolatey, this "shortcut" and potentially the EXE itself, will be removed, so this application will no longer function.

I would suggest that you take a look at the Chocolatey\Lib folder, and see which packages you have installed with Chocolatey before uninstalling, so that you can verify that no applications fall into this category.

Hope that helps!

The steps to uninstall Chocolatey are listed here.

As a side note, starting with Chocolatey 0.9.8.27, the default Chocolatey Path is no longer C:\Chocolatey, but rather C:\ProgramData\Chocolatey.

  • 1
    Surely (given your explanation that some executables may be removed or have links to them removed), the "general" advice should be, "No, it isn't safe"? Only in the specific circumstance where the user is sure that none of the installed software relies in whole or in part on the contents of the choco bin folder should removal be considered harmless. – Bob Sammers May 25 '16 at 11:42
  • @BobSammers I generally agree with this statement. Gary's answer probably needs a little updating since it was written almost two years ago and there is more knowledge share on this. – ferventcoder May 25 '16 at 14:54
4

Uninstalling Chocolatey

Should you decide you don't like Chocolatey, you can uninstall it simply by removing the folder (and the environment variable(s) that it creates). Since it is not actually installed on your system, you don't have to worry that it cluttered up your registry (the applications that you installed with Chocolatey or manually, now that's a different story).

A different story indeed, as i don't recall seeing the Atom editor in my Windows installed programs list. I've uninstalled that via a command line (ran as administrator):

cuninst atom

And the no registry part is actually false. On Windows 7, i had to do this:

reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v ChocolateyInstall

On other versions it might be this:

reg delete HKLM\Environment /f /v ChocolateyInstall

To remove the folder from the command line, use this:

rmdir /Q /S C:\ProgramData\chocolatey

Or this, if you use or upgraded from Chocolatey < 0.9.8.27:

rmdir /Q /S C:\Chocolatey

After all that, the normal Start menu shortcut to C:\ProgramData\chocolatey\lib\Atom.0.141.0\tools\Atom\atom.exe was still present, but when used Windows asks whether you wish to delete it.

  • The no registry comment is about the uninstaller keys. It does specifically state you need to remove the environment variables (look at the text you pasted in). "(and the environment variable(s) that it creates)" - it's a registry key, but you don't have to edit the registry directly to remove it. – ferventcoder May 25 '16 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.