Is it safe to uninstall Chocolatey?

25,536

Solution 1

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.

Solution 2

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.

Share:
25,536

Related videos on Youtube

Thomas Weller
Author by

Thomas Weller

I'm trainer at Mitutoyo CTL Germany and e.g. responsible for students and pupils. I'm also training kids for Electronics and we're building a CPU. On SO I'm mainly answering debugging related questions and I'm proud to be the first and currently only owner of a golden windbg badge. But trust me, there are people who know WinDbg much better than me and do stuff that really astonishes me. Previous positions: Software Developer Senior Project Manager Group Manager Test Manager

Updated on September 18, 2022

Comments

  • Thomas Weller
    Thomas Weller almost 2 years

    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.

  • Bob Sammers
    Bob Sammers about 8 years
    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.
  • ferventcoder
    ferventcoder about 8 years
    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
    ferventcoder about 8 years
    @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.