Apt pinning is a feature that allows to set install priority for a group of packages, determined by a number of attributes, such as package version, repository, distro version, etc.

See man apt_preferences for more (http://linux.die.net/man/5/apt_preferences)


APT then applies the following rules, listed in order of precedence, to determine which version of a package to install.

  • Never downgrade unless the priority of an available version exceeds 1000. ("Downgrading" is installing a less recent version of a package in place of a more recent version. Note that none of APT's default priorities exceeds 1000; such high priorities can only be set in the preferences file. Note also that downgrading a package can be risky.)
  • Install the highest priority version.
  • If two or more versions have the same priority, install the most recent one (that is, the one with the higher version number).
  • If two or more versions have the same priority and version number but either the packages differ in some of their metadata or the --reinstall option is given, install the uninstalled one.

Is there anything like that for Fedora? In other rpm-based distros?

2 Answers 2


Yum has a plugin architecture, and there are several plugins which implement some of what you're looking for. The rules aren't exactly the same, but you may be able to get a behavior which matches your needs.

  • yum-plugin-protectbase: This plugin allows certain repositories to be protected. Packages in the protected repositories can't be overridden by packages in non-protected repositories even if the non-protected repo has a later version.
  • yum-plugin-versionlock: This plugin takes a set of name/versions for packages and excludes all other versions of those packages (including optionally following obsoletes). This allows you to protect packages from being updated by newer versions, for example.

And, not strictly related but maybe useful:

  • yum-plugin-protect-packages: this plugin prevents Yum from removing itself and other protected packages. By default, yum is the only package protected, but by extension this automatically protects everything on which yum depends (rpm, python, glibc, and so on). Therefore, the plugin functions well even without compiling careful lists of all important packages. (This latest is built-in to recent yum.)

There's some documentation of the versionlock plugin in the yum faq.

All of these are in individual sub-packages, so you can just yum install yum-plugin-versionlock, and then check the configuration, usually under /etc/yum/pluginconf.d/. (There's also decent man pages for yum-versionlock and for yum-versionlock.conf.)


Apt is available for Fedora, and is just a port of the Debian one afaik. So you could use pinning with that.

  • Well, you could. It's not just a port, since it has to do a whole bunch of stuff in order to map to rpm rather than dpkg underneath. And that means the semantics don't always line up cleanly.
    – mattdm
    Commented Mar 2, 2011 at 16:19
  • It's also worth mentioning that apt-rpm doesn't seem to be actively developed or maintained. The last primary developer of the project now works for Red Hat and has taken over rpm itself, so he has his hands full.
    – mattdm
    Commented Mar 2, 2011 at 17:27
  • @mattdm: Well, according to apt-rpm.org/scm there is some recent activity in 2010. not a lot, granted. Also, the last stable release was in early 2008. However, Debian's apt has also gone through long inactive periods too. Let's hope the project doesn't die. I assume you are talking about Panu Matilainen above. Commented Mar 2, 2011 at 20:43
  • dont do that...
    – sjas
    Commented Jul 6, 2018 at 17:56

You must log in to answer this question.

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