46

I want to be able to use choco upgrade all -y to update almost all of my Chocolatey packages.

Some packages represent applications that I want to have installed, but I no longer want them to be updated, at least not automatically by the choco upgrade all command.

Can I remove a package from Chocolatey without actually uninstalling the application? That would have the desired effect.

Or can I achieve my goal in a better way?

ferventcoder
  • 4,717
  • 2
  • 19
  • 18
Klas Mellbourn
  • 2,166
  • 2
  • 25
  • 32
  • 3
    You can use pin (see `choco pin -h` for details) and Chocolatey will not try to upgrade the package. https://github.com/chocolatey/choco/wiki/CommandsPin – ferventcoder Dec 11 '15 at 17:41
  • A new option is synchronize in pro/business - https://chocolatey.org/docs/features-synchronize – ferventcoder Sep 05 '16 at 20:14

2 Answers2

63

Example (remove the package myExamplePackage from chocolatey without uninstalling)

choco uninstall myExamplePackage -n --skipautouninstaller

From the chocolatey docs:

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.

Patrick Heck
  • 731
  • 5
  • 3
50

You have two options:

  1. You can use pin (see choco pin -h for details) and Chocolatey will not try to upgrade the package: choco pin add -n=packageName. After that command choco upgrade all will skip package with name packageName.

  2. You can remove application from Chocolatey database (you must remove application folder). All applications metadata are stored in folder C:\ProgramData\chocolatey\lib\<package-name>, example: C:\ProgramData\chocolatey\lib\adobereader.

    Remove directory carefully, because sometimes applications are installed inside chocolatey applications folder, example: C:\ProgramData\chocolatey\lib\javadecompiler-gui\jd-gui-windows-1.4.0

StarGeek
  • 1,324
  • 8
  • 17
agabrys
  • 750
  • 8
  • 10
  • Looks like that works. And this has no ill side effects for chocolatey? No config files that need to be modified? – Klas Mellbourn Dec 09 '15 at 15:18
  • 1
    Chocolatey stores all packages data in `lib` folder, so you can safely remove those folders. – agabrys Dec 09 '15 at 15:45
  • 2
    Option 2, I won't edit this (as it is already the accepted answer), but you can also pin the packages you don't want upgraded. It's a much better solution versus having to manually go and remove the files. – ferventcoder Dec 11 '15 at 17:39
  • @agabrys if you want me to edit the answer I can add the details about pin. Or you can edit it. – ferventcoder Dec 11 '15 at 17:42
  • 2
    I modified the answer. Always feel free to extends any answers ;) – agabrys Dec 11 '15 at 21:43
  • You can also add the new synchronize feature as Option 3 - https://chocolatey.org/docs/features-synchronize – ferventcoder Sep 05 '16 at 20:15
  • The question is "how to remove an application from chocolatey (registry) without uninstall it from the operating system". Synchronization is a feature which will uninstall application form chocolatey, after you uninstall it from the operating system. So I think that option does not fit into the answer :-) – agabrys Sep 06 '16 at 08:33
  • I can't understand how to use the pin command. Can you edit your answer and add full command for a package? – user198350 Sep 04 '17 at 19:08