37

Is it possible to pin a version of a debian package?

Is it possible to pin only the major version? (like with pip install "pyramid < 1.4.0" will install the latest 1.3.x but will not upgrade the major version)?

0

2 Answers 2

49

You can do this, for example, by creating a file /etc/apt/preferences.d/yourpackage as

Package: yourpackage
Pin: version 7.*
Pin-Priority: 999

This would allow upgrades to yourpackage to versions matching 7.*

3
  • 2
    Thanks so needed this. TBH I google a bit and cannot find some definitive and comprehensive doc for apt pinning apart from tutorials which are sometimes too specific and random docs here and there. Is there some official doc anywhere?
    – eirc
    Commented Aug 31, 2016 at 10:46
  • 1
    Haven't seen much other than: man apt_preferences
    – Gregor
    Commented Aug 31, 2016 at 21:12
  • 3
    help.ubuntu.com/community/PinningHowto
    – slm
    Commented Jul 29, 2018 at 23:16
0

I prefer to do this to exclude a single version, as I have many machines in "testing".I has the advantage that versions above or below will be deployed.

Package: python3-pycurl
Pin: version 7.45.3-*
Pin-Priority: 1

You must log in to answer this question.

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