> For the complete documentation index, see [llms.txt](https://pshizhsysu.gitbook.io/linux/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pshizhsysu.gitbook.io/linux/yum/huan-jing-bian-liang.md).

# 环境变量

我们在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）
