Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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.

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.