Centos yum中的$releasever和$basearch变量
来自三线的随记
在Centos中
yum.repos.d下的repo文件,经常能看到$releasever 和 $basearch变量
[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 即release version
取值
rpm -qi centos-release
结果中的version字段
[root@router yum.repos.d]# cat /etc/redhat-release CentOS Linux release 7.8.2003 (Core) [root@router yum.repos.d]# rpm -qi centos-release Name : centos-release Version : 7 Release : 8.2003.0.el7.centos Architecture: x86_64 Install Date: Sat 13 Jun 2020 07:01:32 PM HKT Group : System Environment/Base Size : 43849 License : GPLv2 Signature : RSA/SHA256, Tue 14 Apr 2020 11:54:48 PM HKT, Key ID 24c6a8a7f4a80eb5 Source RPM : centos-release-7-8.2003.0.el7.centos.src.rpm Build Date : Wed 08 Apr 2020 06:01:12 AM HKT Build Host : x86-01.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS Summary : CentOS Linux release file Description : CentOS Linux release files [root@router yum.repos.d]#
此处为version为7
而basearch自然就是架构了
[root@router yum.repos.d]# uname -ip x86_64 x86_64 [root@router yum.repos.d]# arch x86_64