2

Is there any way to tell the yum variables parser where the variable name starts and ends?

I'm having trouble embedding $releasever.

For example, this works:

# cat test.repo
[RHEL$releasever]
name=RHEL$releasever test
# yum  repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
repo id                   repo name         status                                                                                      
RHEL6                     RHEL6 test        0                                                                                           
repolist: 0
#

but this doesn't:

# cat test.repo
[RHEL$releasever_SOMETHING]
name=RHEL$releasever test
# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Bad id for repo: RHEL$releasever_SOMETHING, byte = $ 4
Loading mirror speeds from cached hostfile
repolist: 0
#

Alas, yum does not recognize ${releasever} or $(releasever) -- shell style and Make style. Is there some other way to do it within yum?

Right now we have multiple yum repositories that are named like RHEL5_something and RHEL6_something and I want to consolidate that to RHEL$releasever_something as it would simplify our configuration management.

I can still consolidate the config by using a config mgmt variable rather than a yum variable; I just want to know if yum can do it?

3

This is a known issue which has been last updated by Red Hat on 4 January 2017 as of this writing. The only workaround which I can suggest is to move SOMETHING to before your invocation of $releasever.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.