Bug 1287333 - Not possible to override distroverpkg from /etc/yum.conf with --setopt
Not possible to override distroverpkg from /etc/yum.conf with --setopt
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: yum (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: Valentina Mukhamedzhanova
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-01 19:17 EST by Ian Wienand
Modified: 2017-07-18 06:28 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Wienand 2015-12-01 19:17:19 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 [1] 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.  

[1] http://yum.baseurl.org/gitweb?p=yum.git;a=blob;f=yum/config.py;h=0dcbc6a6f56fb91394045c945739a1a6fbe5584c;hb=HEAD#l1055

Note You need to log in before you can comment on or make changes to this bug.