环境变量

我们在repo文件中经常会遇到yum的环境变量,比如如下的文件

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

releasever

如果细心,在/etc/yum.conf文件中会有如下一行内容

cachedir=/var/cache/yum/$basearch/$releasever

然后我们去到/var/cache/yum/目录下会发现,$basearch的值为x86_64$releasever的值为7(7.5.1804与7.6.1810版本的值都为7)

Last updated