6

I upgrade all my packages weekly with

cup all -y

However there are several applications that I use infrequently. I want to upgrade them about once every 6 or 12 weeks. So I pinned them. That is working out very well. But how do I override a pin? It has been about two months since I pinned about 4 packages. I want to upgrade them?

I was hoping that if I specified a pinned package by name that chocolatey would understand that I really wanted to upgrade it.

choco upgrade thunderbird

That got me nowhere.

thunderbird is pinned. Skipping pinned package

Please don't tell me I have to unpin each package I pinned, then upgrade all, then re pin the ones that I had just unpinned.

3 Answers 3

8

In the current release of Chocolatey, 0.10.15, there isn't a way to bypass the pin that is in place on a package. You would need to do:

choco pin remove -n=thunderbird
choco upgrade thunderbird
choco pin add -n=thunderbird

There is an enhancement request for providing the required ability here:

https://github.com/chocolatey/choco/issues/2050

I would suggest that you subscribe to that, and provide any additional input for required functionality.

0

There is an easier way to do this (instead of writing it three times): -

The below will list everything that's pinned - then you just type / copy+paste the results in and boom

$packages = @()
$test = choco pin list | Select-Object -skip 1
foreach ($t in $test) {
    $packages += $t.Substring(0, $t.IndexOf('|'))
}

$package = read-host "which package do you wish to upgrade? $packages"
choco pin remove -n=$package 
choco upgrade $package 
choco pin add -n=$package 
0

I'm sorry, I don't have permission to comment code here. The correct form of the script of @charles Delroy is:

$packages = @()
$test = choco pin list | Select-Object -skip 1
foreach ($t in $test) {
    $packages += $t.Substring(0, $t.IndexOf('|'))
}

$package = read-host "which package do you wish to upgrade? $packages"
$package
choco pin remove -n="$package"
choco upgrade $package
choco pin add -n="$package"

There were some "" missing.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .