How to update all Chocolatey packages except one?

You have two options: pin a package in advance, or exclude items during choco upgrade.

Pin Packages to Suppress Upgrades

You can pin any program you don't want updated.

Type choco pin -h for more details. If that command doesn't give you anything, please upgrade Chocolatey to at least 0.9.9.x.

Pin Command

Pin a package to suppress upgrades.

This is especially helpful when running choco upgrade for all packages, as it will automatically skip those packages. Another alternative is choco upgrade --except="pkg1,pk2".

Usage

choco pin [list]|add|remove [<options/switches>]

Examples

choco pin
choco pin list
choco pin add -n=git
choco pin add -n=git --version 1.2.3
C4B: choco pin add -n=git --version 1.2.3 --reason "'others may need to review'"
choco pin remove --name git

NOTE: --reason option ONLY available in Chocolatey for Business (C4B).

Exclude Packages While Upgrading

Sometimes you just simply want to exclude items you would normally include in upgrades. You don't want pins as those are meant to live longer than a single command run. That is where the Exclude option comes in to your upgrade command.

As of Chocolatey v0.9.10, when calling upgrade, you can pass the optional --except as a switch for upgrade. An example would be choco upgrade all --except="'conemu'".


According to the official documentation:

choco upgrade all --except="'skype,conemu'"

Tags:

Chocolatey