Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

On CentOS exists the yum versionlock option, where you can lock a package to a specific version, so it is never upgraded past that.

I would like that

puppet-server-2.7.19-1
puppet-2.7.19-1

stays on 2.7, and never upgraded to 3.0. Puppet Labs have released 3.0 and put it into the stable repo, so 2.7 will get upgraded to 3.0, which is not backwards compatible.

Does Ubuntu have something similar to yum versionlock?

share|improve this question

marked as duplicate by Magellan, Tim Brigham, Falcon Momot, dawud, Jenny D Oct 10 '13 at 12:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 10 down vote accepted

You can create a file in /etc/apt/preferences and pin packages' version.

The format for the file would be somewhat like this:

Package: puppet-server
Pin: version 2.7*
Pin-Priority: 550

See also:

share|improve this answer
    
The Pin: 2.7* line should read Pin: version 2.7* –  Choffee Nov 26 '12 at 11:41
    
Thank you. Fixed –  jokerdino Nov 26 '12 at 11:45

You can try this:

aptitude hold puppet-server puppet
echo "puppet-server hold" | dpkg --set-selections
echo "puppet hold" | dpkg --set-selections
share|improve this answer
    
hold will keep the package at the current version, and not let it upgrade any further. I would like it to upgrade to any 2.7.x but not 3.x.x –  Sandra Oct 5 '12 at 11:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.