The meaning of each variable yum file

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-using_yum_variables

https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/6/html/deployment_guide/index

6.3 . 3 . Use of YUM variable
 yum command and use the following built-in variables in all of Yum configuration file / reference can be (that is, / Etc / yum .Conf and / Etc / yum .Repos.D / all in the directory .repo file):
 
$ Releasever When you use this variable, you can refer to the release version of Red Hat Enterprise Linux. Yum is
/ Etc / Yum Gets a value of $ releasever than the line of distroverpkg = value in the .conf configuration file. / Etc / Yum If such a line is not in the .conf is, Yum is redhat- be to get the version number from the release package, it will lead to the correct value. $arch Using this variable, Python of Os. Uname You can refer to the CPU architecture of the system as a return value when calling () function. Valid values of $ arch is, i586, i686, is x86_64.
$ basearch When you use the $ basearch, you can refer to the base architecture of the system. For example, i686 and i586 Both machines have a base architecture of i386, AMD64 and Intel64 machine has a base architecture of x86_64.
YUM0 $
- 9 of these 10 is one of the variables, are each a substituted and the value of the shell environment variables with the same name. Any of these variables (for example, / Etc / Yum in .conf) is referred to, and if the shell environment variable with the same name does not exist, variable in the configuration file is not replaced. Definition of a custom variable, to do the overwriting of an existing variable values, / Etc / Yum to create a file with the same name as the variable in the / vars / directory ( "$" symbol none), 1 hope to line Add the value to be.
For example, in the case of many, in detail repository will contain the name of the operating system. $ To define a new variable that is referred to as the Osname,
1 to create a new file with the name of the "Red Hat Enterprise Linux" on the line, / Etc / Yum / Vars / and save it as Osname: ~] # Echo " Red Hat Enterprise Linux " > / Etc / Yum / Vars / Osname In .repo file, "Hat Enterprise Linux Red 6 You can use the following instead of": name=$osname $releasever

 

6.3.3. The use of YUM variable

yum  It is possible to command and reference use / the following built-in variables in all of Yum configuration file (that is,  /etc/yum.conf  and  /etc/yum.repos.d/  all of the directory  .repo  file):
$releasever
When you use this variable, you can refer to the release version of Red Hat Enterprise Linux. Yum is  /etc/yum.conf  in the configuration file   than the line of   to get the value of.  If such a line is not present,  the  redhat-release  it to get the version number from the package, will lead to the correct value. distroverpkg=value $releasever /etc/yum.conf yum
$arch
Using this variable, of Python  os.uname()  You can refer to the CPU architecture of the system as a return value when calling the function. $arch  Valid values i586 of, i686 , , x86_64  it is.
$basearch
$basearch  When you use, you can refer to the base architecture of the system. For example, the i686 and i586 both machines  i386  have a base architecture of, the AMD64 and Intel64 machine  x86_64  has a base architecture.
$YUM0-9
These 10 variables are each a substituted and the value of the shell environment variables with the same name. Any of these variables (for example  /etc/yum.conf  in a) is referred to, and if the shell environment variable with the same name does not exist, variable in the configuration file is not replaced.
Definition of a custom variable, to do the overwriting of existing variable values, /etc/yum/vars/  to create a file with the same name as the variable in the directory ( " $"  symbol none), add the desired value in the first row.
For example, in the case of many, in detail repository will contain the name of the operating system. $osname  And to define a new variable is called, in the first line  , " Red Hat Enterprise Linux "  to create a new file with the name of, /etc/yum/vars/osname  as you save:
~]# echo "Red Hat Enterprise Linux" > /etc/yum/vars/osname
.repo  In the file, " Red Hat Enterprise Linux 6 ,"  you can use the following instead of:
name=$osname $releasever

Guess you like

Origin www.cnblogs.com/tekikesyo/p/12205192.html