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 1708204 - Do not create /etc/yum.repos.d on redhat-release installation
Summary: Do not create /etc/yum.repos.d on redhat-release installation
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: redhat-release
Version: 8.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 8.1
Assignee: Djordje Todorovic
QA Contact: Release Test Team
Depends On:
Blocks: 1653484
TreeView+ depends on / blocked
Reported: 2019-05-09 11:15 UTC by Marek Blaha
Modified: 2021-02-01 07:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2021-02-01 07:40:44 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

Description Marek Blaha 2019-05-09 11:15:19 UTC
Description of problem:
redhat-release package creates an empty /etc/yum.repos.d directory during installation.

This breaks DNF's detecting the location of the repository configuration files in case that the --installroot option was used.

E.g. in case of "dnf install --installroot=/the/installroot/ bash":
1. DNF try to use "guest" directory - it looks if path /the/installroot/etc/yum.repos.d exists. If so, it uses this directory as repository configuration path (which is an empty directory in case the redhat-release was installed previously)
2. In case this path does not exist, DNF will use configuration from "host" (/etc/yum.repos.d directory) instead.

That means after installing redhat-release into the install root user is not
able to install any other package because there are not any repositories configured.

Version-Release number of selected component (if applicable):
# rpm -q redhat-release

How reproducible:

Steps to Reproduce:
# rm -rf /the/installroot

# dnf --releasever=el8 --installroot=/the/installroot install redhat-release

# ls -la /the/installroot/etc/yum.repos.d/
total 0
drwxr-xr-x. 2 root root   6 Mar  5 10:44 .
drwxr-xr-x. 7 root root 188 May  9 07:03 ..

# dnf --releasever=el8 --installroot=/the/installroot install bash
Error: There are no enabled repos.

# rmdir /the/installroot/etc/yum.repos.d

# dnf --releasever=el8 --installroot=/the/installroot install bash

Actual results:
No enabled repos.

Expected results:
Repos from "host" system are available

Additional info:

Comment 1 Tomas Mlcoch 2019-05-10 12:18:08 UTC
Chris, I wonder if this change won't break subscription-manager?

Comment 2 Lisa S 2020-04-03 20:04:15 UTC
Chris, can you answer the question above?

Comment 6 Chris Snyder 2020-09-02 19:54:05 UTC
In subscription-manager's current form, users will still be able to register, attach / remove subscriptions and so on. However, subscription-manager does not create this directory if it does not exist resulting in no access to any content provided in the form of a repo that comes from an entitlement.

As soon as this directory is created (and rhsmcertd runs, or any subman command that reconciles entitlements) the correct redhat.repo file will be generated.

Could dnf be modified to handle the special case of an empty /installroot/etc/yum.repos.d/ directory?
It could treat an empty /installroot/etc/yum.repos.d directory as it does with a nonexistant /installroot/etc/yum.repos.d folder, rely on the host /etc/yum.repos.d directory.

Comment 10 RHEL Program Management 2021-02-01 07:40:44 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

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