How to set the value of “$releasever” permanently for yum

In a test server I typed “sudo yum update”, it reported errors like:

Then I found this web in google for introducing how to get the value of “$releasever”, but it does not tell us how to set “$releasever” permanently. Therefore, I have to search word like “releasever” in the source code of ‘yum’:

Finally the source code in ‘/usr/lib/python2.6/site-packages/yum/’ comes out:

But where does ‘self.conf.yumvar’ get its values? The answer is ‘/etc/yum/vars/’. After

My ‘sudo yum update’ works correctly now.