choco
choco copied to clipboard
upgrade: Add a switch to disable pin when upgrade
Motivation
I've pinned powershell-core because you mess up if you upgrade PowerShell Core in PowerShell Core.
So when I have to upgrade PowerShell Core, I have to remove pin and upgrade and add pin again.
Specifically, I follow this procedure:
choco upgrade allin PowerShell Core- Checks Powershell Core has an upgrade (with
this package is pinnedwarning message) - Go to safer terminal (such as PowerShell 5.1)
choco pin remove -n=powershell-corein Powershellchoco upgrade powershell-corein Powershellchoco pin add -n=powershell-corein Powershell
The point is someone uses pin for delay upgrades, not to block upgrades forever.
Solution
Add a switch --disable-pin to upgrade.
When this switch is enabled, pinned packages will be upgraded.
choco upgrade powershell-core --disable-pin has same effect with the above procedure 4-6.
Other suggestions
Switch name could be
--ignore-pin--exclude-pin--disable-pin-once
I think this may already be an issue? Or at least something related like install with pin.
Hear, Hear! I could not agree more. I asked this exact question on StackExchange Super User.
At the least, it would be nice if the documentation for pinning explicitly stated that there is no way to temporarily bypass the pin. One can only manually remove the pin, upgrade and repin.
Notwithstanding my asking for more, Chocolatey is really good. Thank you.
I think this may already be an issue? Or at least something related like install with pin.
@ferventcoder is there any progress with that feature ?
The Chocolatey docs specifically recommend using pin as a solution for auto-updating apps like Firefox and Chrome, as apparently auto synching doesn't work for package updates. Yet that leaves no way to manually roll out packages updates to the hosts that don't keep those auto-updating applications constantly open.
I don't understand why pinning doesn't just only prevent "choco upgrade all", or hide the package in "choco outdated". Preventing the package from updating at all is a poor solution especially when there's no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.
no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.
@nascentt how about using upgradeAllExceptions instead of pins? See choco config -h for more info on the setting.
no administrative way to just issue a package upgrade without fiddling around with toggling the pin off and on again.
@nascentt how about using
upgradeAllExceptionsinstead of pins? Seechoco config -hfor more info on the setting.
strange, I don't see upgradeAllExceptions mentioned at all in choco config -h. Additionally, I don't see it documented anywhere, only getting 7 results in google.
Playing around with both methods, I'm unsure of the main use case for one over the other. both require chocolatey admin knowledge to bypassed, and both can be bypassed, neither prevent apps showing up in choco outdated by default, although there is a switch to ignore pinned in choco outdated it's not default. But upgradeAllExceptions is good because it completely hides packages by default, but that's only for upgrade and not outdated so can still confuse users. Also upgradeAllExceptions can be set before/regardless of whether the pack is installed yet (so can be set at build time) whereas pin can only be set after the package has been installed (which is a major limitation) apparently there's yet another issue for fixing this which is outstanding.
I guess neither solution really fixes the underlying issue that choco sync doesn't work for version changes, which should really be fixed.
I do still believe choco upgrade should have a switch to ignore pins the same way choco outdated does though. For both preventing hacky workaround like disable;upgrade;enable, but also consistency.
regarding the name, as choco upgrade has -ignore-pinned I feel the name of the switch on choco upgrade should be the same
choco upgrade --ignore-pinned
Whoops, sorry that should be choco config -l