Pages

Tuesday, October 8, 2013

Yum custom variables

While defining the your local yum repository you can use YUM's in built and custom variable, most commonly used are


$releasever
This is replaced with the package's version, as listed in distroverpkg. This defaults to the version of the redhat-release package. ( this is defined in /etc/yum.conf)
e.g rpm -q --queryformat '%{VERSION}' centos-release-5-9.el5.centos.1

$arch
This is replaced with your system's architecture, as listed by os.uname() in Python.
$basearch
This is replaced with your base architecture. For example, if $arch=i686 then $basearch=i386.
$YUM0-9
This is replaced with the value of the shell environment variable of the same name. If the shell environment variable does not exist, then the configuration file variable will not be replaced.


IF you are using Centos6 (rhel 6) you can define a custom variable or  override the value of an existing one, using file with the same name as the variable (without the $ sign) in the /etc/yum/vars/ directory, and add the desired value on its first line.

e.g. 

[root@myhost~]# cat /etc/yum/vars/releasever
6.4




Also have multilib_policy defined in your yum.conf to download the required architecure rpms only (32 bit /64 bit)

multilib_policy=best


No comments:

Post a Comment