Red Hat Bugzilla – Bug 1251774
[RFE] DNF should support custom variables for repo files (same as /etc/yum/vars)
Last modified: 2017-11-01 06:34:22 EDT
Description of problem:
yum supports custom variables by putting files into /etc/yum/vars
From the man page of yum.conf:
"As of 3.2.28, any properly named file in /etc/yum/vars is turned into a variable named after the filename (or over‐rides any of the above variables).
Filenames may contain only alphanumeric characters and underscores and be in lowercase."
This feature does not seem to exist in dnf.
Version-Release number of selected component (if applicable):
Installed: dnf-0:1.0.1-2.fc22.noarch at 2015-08-09 21:27
Built : Fedora Project at 2015-06-12 09:00
Installed: rpm-0:184.108.40.206-12.fc22.x86_64 at 2015-08-09 21:26
Built : Fedora Project at 2015-06-29 10:36
Always. It is a missing feature.
*** This bug has been marked as a duplicate of bug 1211253 ***
I disagree that this is a duplicate of #1211253. This bug is about overriding an existing variable from the command line.
What this bug is about is creating custom variables and storing their values on the file system. yum allows this by creating files in /etc/yum/vars. No such mechanism exists in dnf and the #1211253 does not talk about this.
Closing this bug as a duplicate means that this RFE will get lost. I would like to keep it open because it addresses a different problem.
BTW, can you please tell us what is your use case? Maybe some examples (the more the better)?
Created attachment 1071539 [details]
sample repo file
I attached a demo file which we use to share repo files between e.g. Fedora and RHEL / CentOS. We set a custom variable 'some-service_distro' to either "fedora" or "rhel" to select the main repo and drop this variable into /etc/yum/vars as part of our installation process. This allows us to maintain only a single repo file for all distribution flavors.
I'd like to see this yum feature re-introduced to DNF too.
My primary use case is that we have some repos where we require HTTP auth for access from outside our company networks, by systems which other people may have access to (so we don't want a single set of shared credentials), so we set up these repos with a baseurl of
or some such then and then drop our_auth into /etc/yum/vars, this allows us to configure the auth across all the relevant repos in a single place.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.
Let's track in upstream: https://github.com/rpm-software-management/libhif/issues/170
*** Bug 1211253 has been marked as a duplicate of this bug. ***