Bug 1279185

Summary: dnf searches in /etc/yum.repos.d/*.repo when using --installroot
Product: [Fedora] Fedora Reporter: Ali Akcaagac <aliakc>
Component: dnfAssignee: Jaroslav Mracek <jmracek>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: jef.oliver, jmracek, jsilhan, mluscon, msuchy, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-21 14:15:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ali Akcaagac 2015-11-08 13:29:28 UTC
I hit a strange behaviour, when using dnf with the --installroot option.

To explain it better, let's use yum for this example:

yum update --installroot=/<somepath>

When issuing this command, the following happens:

1) yum uses the repo files located in /<somepath>/etc/yum.repos.d/.*repo
2) yum uses the cache of /<somepath>/cache/yum.... to store the metadata
3) yum uses the cache of /<somepath>/cache/yum.... to store updated nevra
4) yum uses the cache of /<somepath>/lib/yumdb... to store the db entries

With other words, using --installroot does a full context switch (as I explain it) to a different "root". Not touching the underlaying systems yum.repos.d etc.

This has the advantage, that I can use the real host system (the true one in /) to update a different system (one for systems integration, different updates or other related tasks) in --installroot (which of course can have other .*repo files, other activated ones or disabled ones or other added ones.

When using dnf otoh, it does only steps 2 - 4... sadly dnf searches in the true / (root) directory for repo files. Thus ignoring the repo files found in /<somepath>/yum.repos.d/*.repo.

Temporarely (and contradicting to yum) I have to temporarely copy over the files found in /<somepath>/yum.repos.d/.*repo to /etc/yum.repos.d/ whenever issuing the --installroot command.

With other words... dnf is not correctly switching the context ... when I intend dealing with a different --installroot, then I not only want to store the metadata, cache, downloaded nevra in the installroot but also use the repo files found in the installroots /etc/yum.repos.d directory.

Comment 1 Honza Silhan 2015-11-18 12:18:27 UTC
Thanks for the report. We'll take look.

Comment 2 Jaroslav Mracek 2016-01-13 08:57:46 UTC
This behavior is fixed by pull-request https://github.com/rpm-software-management/dnf/pull/428

Comment 3 Jaroslav Mracek 2016-01-13 14:53:36 UTC
*** Bug 1160612 has been marked as a duplicate of this bug. ***

Comment 4 Jaroslav Mracek 2016-02-15 14:30:09 UTC
*** Bug 1304887 has been marked as a duplicate of this bug. ***

Comment 5 Mike McCune 2016-03-28 23:16:15 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Fedora End Of Life 2016-07-19 18:26:23 UTC
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
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 7 Ali Akcaagac 2016-07-19 18:37:41 UTC
Reopened.

Comment 8 Igor Gnatenko 2016-07-21 14:15:05 UTC
Fixed as part of DNF 2.0 which will be available at some point in the near future.