RPM/Yum

De TartareFR
Aller à la navigation Aller à la recherche

How can I get yum to keep package "foo" at a certain version in a fashion similar to pinning provided by apt?

There are several ways you can do this.

  • One is to exclude it from your updates list. See man yum.conf for more details.
  • Another way to pin package "foo" to a certain version is to use the versionlock plugin.

If you are using the latest Fedora ( version >= 12)

then the plugin can be installed using:

yum install yum-plugin-versionlock

To add files that you want version locked, use the following yum command:

yum versionlock <package-name>

you can also use wildcards:

yum versionlock <package-name>-*

This command line will add lines to:

/etc/yum/pluginconf.d/versionlock.list

The config file uses the following format: EPOCH:NAME-VERSION-RELEASE.ARCH which can be obtained using:

rpm -q <package name> --queryformat "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}\n "

If no EPOCH is specified in the package, then the number will be 0.

Alternatively if you are using Redhat 5/CentOS 5 or another OS that does not yet have the latest yum available

you can use:

yum install yum-versionlock

This older version of the plug-in does not extend command line flags that you can pass to yum and the lock list must be edited manually.

For a manual install the source can be obtained from the current git repository for yum which is http://yum.baseurl.org/gitweb The files you need will be found in the yum-utils/plugins/versionlock part of the git tree. Copy <path>versionlock.py</path> to <path>/usr/lib/yum-plugins/versionlock.py</path> Copy versionlock.conf to /etc/yum/pluginconf.d/versionlock.conf Create <path>/etc/yum/pluginconf.d/versionlock.list</path> All files should be root.root with 644 permissions.