Remove Chocolatey registration without uninstalling application
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?
Solution 1:
You have two options:
-
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 commandchoco upgrade all
will skip package with namepackageName
. -
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
Solution 2:
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.