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?

up vote 19 down vote accepted

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

  • Looks like that works. And this has no ill side effects for chocolatey? No config files that need to be modified? – Klas Mellbourn Dec 9 '15 at 15:18
  • 1
    Chocolatey stores all packages data in lib folder, so you can safely remove those folders. – agabrys Dec 9 '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

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.

  • I can't figure out how to use the command - can you tell me the full command for a package? – user598527 Sep 4 '17 at 18:32
  • 1
    sure - I added an example to the post. – Patrick Heck Sep 6 '17 at 7:29
  • This no longer seems to work with the current version of Chocolatey – Mica Feb 18 at 5:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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