<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=CentOS%3Ayum%E6%BA%90%E4%B8%AD%24releasever%E5%8F%98%E9%87%8F</id>
	<title>CentOS:yum源中$releasever变量 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=CentOS%3Ayum%E6%BA%90%E4%B8%AD%24releasever%E5%8F%98%E9%87%8F"/>
	<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=CentOS:yum%E6%BA%90%E4%B8%AD$releasever%E5%8F%98%E9%87%8F&amp;action=history"/>
	<updated>2026-06-02T20:39:20Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=CentOS:yum%E6%BA%90%E4%B8%AD$releasever%E5%8F%98%E9%87%8F&amp;diff=1254&amp;oldid=prev</id>
		<title>imported&gt;Soleverlee：​以“CentOS源中很多地方用版本号来关联镜像的更新路径。然而这个东西好像经常出错。例如163的repo: &lt;source lang=&quot;properties&quot;&gt; # CentOS-Bas...”为内容创建页面</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=CentOS:yum%E6%BA%90%E4%B8%AD$releasever%E5%8F%98%E9%87%8F&amp;diff=1254&amp;oldid=prev"/>
		<updated>2015-07-02T08:51:51Z</updated>

		<summary type="html">&lt;p&gt;以“CentOS源中很多地方用版本号来关联镜像的更新路径。然而这个东西好像经常出错。例如163的repo: &amp;lt;source lang=&amp;quot;properties&amp;quot;&amp;gt; # CentOS-Bas...”为内容创建页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;CentOS源中很多地方用版本号来关联镜像的更新路径。然而这个东西好像经常出错。例如163的repo:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;properties&amp;quot;&amp;gt;&lt;br /&gt;
# CentOS-Base.repo&lt;br /&gt;
#&lt;br /&gt;
# The mirror system uses the connecting IP address of the client and the&lt;br /&gt;
# update status of each mirror to pick mirrors that are updated to and&lt;br /&gt;
# geographically close to the client.  You should use this for CentOS updates&lt;br /&gt;
# unless you are manually picking other mirrors.&lt;br /&gt;
#&lt;br /&gt;
# If the mirrorlist= does not work for you, as a fall back you can try the&lt;br /&gt;
# remarked out baseurl= line instead.&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
[base]&lt;br /&gt;
name=CentOS-$releasever - Base&lt;br /&gt;
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&amp;amp;arch=$basearch&amp;amp;repo=os&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
今天更新时发现这个值竟然是6Server。奇怪的是这个变量并不在环境变量中。查找资料发现这个值$releasever变量是取redhat-release-server rpm包的属性值( %{version})。&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -q --qf %{version} redhat-release-server&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
如果要修改这个值，可以&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;6&amp;quot;&amp;gt;/etc/yum/vars/releasever&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux/Unix]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Soleverlee</name></author>
	</entry>
</feed>