Red Hat Bugzilla – Bug 1287333
Not possible to override distroverpkg from /etc/yum.conf with --setopt
Last modified: 2017-12-01 21:02:45 EST
centos ships a /etc/yum.conf with "distroverpkg=centos-release"
This causes a problem if you're trying to bootstrap a Fedora environment with something like
$ rpm --root=$PATH_TO_ROOT --initdb
$ rpm --root=$PATH_TO_ROOT -i fedora-release*.rpm
$ yum --installroot=$PATH_TO_ROOT -y install yum
because yum tries to query for "centos-release" package within "--installroot" (which doesn't exist, only fedora-release was installed).
So once you see this, the seemingly obvious thing to do is to use "--setopt=distroverpkg=fedora-release" to this command to get it working (because it was set in /etc/yum.conf)
In  distroverpkg is set after reading the configuration file but before any of the main options are read, so setting via --setopt on the command line doesn't work.
For consistency, it seems like it would be a top-level argument along with "--debug", "--releasever", "--installroot" etc, all of which are setup as the "preconf" variables.
The work-around for this is to use "--releasever", which achieves the same thing.