puppet-apt icon indicating copy to clipboard operation
puppet-apt copied to clipboard

Bet way to 'hold' package version

Open brosev opened this issue 3 years ago • 2 comments

I see that pinning is an option but there doesnt appear to be a parameter for specific version. What's the best way to make sure a package retains it's version?

Thanks!

brosev avatar Sep 21 '21 22:09 brosev

Would be interested, too. Because in the readme it says: apt::hold: This define was removed. Simply use an apt::pin with priority => 1001 for the same functionality.

So I went with the following for my package: apt::pin { 'hold-kubelet': packages => 'kubelet', version => '1.23.3-00', priority => 1001, }

But if I run apt-mark showhold on the server, nothing is shown. But after running apt-mark hold kubelet manually its working. Could somebody explain what I did wrong or is this a bug?

premar avatar Feb 08 '22 20:02 premar

Okay, did some research. I didn't know that pin exists.

So apparently you can do both ways to hold / pin the version of a package.

With hold, by using the mark keyword: package { 'package_name': ensure => '1.0.0', mark => 'hold', } Here apt-mark showhold yields that the package is on hold.

Or you go with the pin approach: apt::pin { 'hold-package_name': packages => 'package_name', version => '1.0.0', priority => 1001, }

Personally I am using from now on the pin option, because this sound like the more robust way.

premar avatar Feb 12 '22 08:02 premar