首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁CentOS:yum源中$releasever变量”︁的源代码
←
CentOS:yum源中$releasever变量
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
CentOS源中很多地方用版本号来关联镜像的更新路径。然而这个东西好像经常出错。例如163的repo: <source lang="properties"> # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os </source> 今天更新时发现这个值竟然是6Server。奇怪的是这个变量并不在环境变量中。查找资料发现这个值$releasever变量是取redhat-release-server rpm包的属性值( %{version})。 <source lang="bash"> rpm -q --qf %{version} redhat-release-server </source> 如果要修改这个值,可以 <source lang="bash"> echo "6">/etc/yum/vars/releasever </source> [[Category:Linux/Unix]]
返回
CentOS:yum源中$releasever变量
。