RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1657150 - dnf not using repos from the host system with --installroot
Summary: dnf not using repos from the host system with --installroot
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.0
Assignee: Jaroslav Mracek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-07 09:26 UTC by Karel Srot
Modified: 2018-12-12 12:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-12 12:19:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Karel Srot 2018-12-07 09:26:06 UTC
Description of problem:

This is a difference compared to RHEL-7 and compared to dnf-2.7 from Alpha.


# yum install systemd --installroot=/tmp/root --releasever=/
... installs systemd package into /tmp/root
# yum install aide --installroot=/tmp/root --releasever=/
Error: There are no enabled repos.

Version-Release number of selected component (if applicable):
dnf-4.0.9-1.el8.noarch

How reproducible:
always

Steps to Reproduce:
1. see above

Additional info:
According to the dnf man page:

config file and reposdir are searched inside the installroot first. If they are not present, they are taken from host system.

Comment 1 Jaroslav Mracek 2018-12-07 12:19:30 UTC
The problem was previously reported in https://bugzilla.redhat.com/show_bug.cgi?id=1582535. Please check discussion there and in PR https://github.com/rpm-software-management/dnf/pull/1191 where there are arguments that confirms that the current behavior of DNF is correct.

I also check a documentation and I found that work-around is well described and difference is also described in yum-dnf differences chapter. See:

- *config file* and :ref:`reposdir <reposdir-label>` are searched inside the installroot first. If
  they are not present, they are taken from host system.
  Note:  When a path is specified within command line argument
  (``--config=<config file>`` in case of *config file* and
  ``--setopt=reposdir=<reposdir>`` for *reposdir*) then this path is always
  related to the host with no exceptions.


Do you think that the bug report is still relevant?

Comment 2 Karel Srot 2018-12-07 14:22:02 UTC
Yes, it is still relevant because the dnf man page (and also upstream doc) are misleading in statement:
"config file and reposdir are searched inside the  installroot  first.
         If  they  are  not  present,  they are taken from host system."

This documentation should be updated at least with additional information explaining that the above applies only to the 1st command issued and once the $installroot/etc/yum.repos.d/ directory exist the host system repos are not used, along with a justification for that.

Comment 3 Jaroslav Mracek 2018-12-07 15:43:57 UTC
Please if you can provide a formulation that would satisfy you it would be great. Thanks a lot.

Comment 4 Karel Srot 2018-12-07 16:30:49 UTC
Well, I would need to know what is the current behaviour first. Does the statement above still apply for config files?

Comment 5 Jaroslav Mracek 2018-12-10 13:30:03 UTC
The man page for installroot option is according to dnf behavior. Therefore I believe that the bug is resolved. Please is there anything what has to be changed?


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