Bug 2005305
Summary: | dnf should not pull (already unmet) weak dependencies on updates | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Jan Pazdziora (Red Hat) <jpazdziora> |
Component: | dnf | Assignee: | Jaroslav Mracek <jmracek> |
Status: | CLOSED ERRATA | QA Contact: | Eva Mrakova <emrakova> |
Severity: | unspecified | Docs Contact: | Mariya Pershina <mpershin> |
Priority: | unspecified | ||
Version: | 9.0 | CC: | emrakova, james.antill, jpazdziora, mpershin, pasik, petersen, pkratoch, tbajer |
Target Milestone: | rc | Keywords: | Triaged |
Target Release: | --- | Flags: | emrakova:
needinfo-
|
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | dnf-4.10.0-1.el9 | Doc Type: | Enhancement |
Doc Text: |
.New DNF options `exclude_from_weak_autodetect` and `exclude_from_weak`
With this enhancement, the default DNF behavior does not install unwanted weak dependencies. To modify this behavior, use the following new options:
* `exclude_from_weak_autodetect`
+
If enabled, the `exclude_from_weak_autodetect` option autodetects unmet weak dependencies (Recommends: or Supplements:) of packages installed on your system. As a result, providers of these weak dependencies are not installed as weak dependencies, but, if pulled in, they are installed as regular dependencies. The default value is `true`.
* `exclude_from_weak`
+
If enabled, the `exclude_from_weak` option prevents installing packages as weak dependencies (Recommends: or Supplements:). You can specify packages either by a package name or a glob, and separate them by a comma. The default value is `[]`.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2022-05-17 15:55: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
Jan Pazdziora (Red Hat)
2021-09-17 11:22:24 UTC
I created PR with a solution: https://github.com/rpm-software-management/dnf/pull/1780, https://github.com/rpm-software-management/libdnf/pull/1279, https://github.com/openSUSE/libsolv/pull/454 Tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1005 This bugzilla focused on updates / upgrades transactions where the "already unmet" dependencies could be observed. If the implemented change also modified the behaviour on installations of previously uninstalled packages, some more tuning to the implementation might be needed to really only kick in for packages being updated. I am really sorry but I provided possibilities incorrectly. Please ignore comment 6 and comment 9. (In reply to Jan Pazdziora from comment #7) > This bugzilla focused on updates / upgrades transactions where the "already > unmet" dependencies could be observed. Firs of all I need to clarify that the feature cannot be implemented only on upgrades - It cannot be achieved for two technical reason - 1. DNF creates one transaction for all operations (install, upgrades are performed together). 2.a Install operation or commands (not only install) also triggers update. (example - I have already installed foo-1-1.noarch. Then I will install bar-2-2.noarch that requires foo-2. It means the install command will trigger upgrade that dnf cannot detect in advance. And if foo recommends something, it will be installed) 2.b Install operation with --best (default in RHEL) triggers always upgrade when package is already installed but in lower version. > If the implemented change also modified the behaviour on installations of > previously uninstalled packages, some more tuning to the implementation > might be needed to really only kick in for packages being updated. Please could you provide your opinion for following options. I really afraid that we have not many other options (we are limited by a schedule and resources). 1. Keep it like it is 2. Disable autodetection 3. Start to ignore rich dependencies for autodetection of unmet weak dependencies. (may be we will be unable to deliver for GA) We have a problem to detect rich dependencies correctly in autodetections because we do not know whether their conditions were met or not in past. 4. In theory the auto-detection can be only triggered by upgrade command but it will create an inconsistency in DNF behavior when upgrade operation is triggered by the another command (install, buildeps, downgrade, ...) - not preferable, see above (not for GA). Which options are preferable? I'm afraid I'm not savvy enough in the internals of dnf and its libraries and what is possible and what not, to pick from the options. One thing I'd like to clarify is the use case though. When I talk about update / upgrade operation, I don't have the specific "dnf update" / "dnf upgrade" command in mind necessarily, I talk about update / upgrade of specific packages. The example you gave, "dnf install bar-2-2.noarch" which forces upgrade of foo package, would be a nice case. If bar itself has some weak dependencies, they should be pulled in, it's an installation of a new package. If foo-2 has a weak dependency that foo-1-1 also had, and that dependency was not met, when the transaction started, I'd expect that weak dependency not to get pulled in. If foo-2 has a new weak dependency that foo-1-1 did not have, I'd expect that weak dependency to get pulled in. (All these assume install_weak_deps=True, of course.) So in one dnf transaction, you might have a mixture of cases -- some of them installations of new packages, some of them new weak dependencies for packages being upgraded (so those dependencies couldn't have been unmet because they did not exist), and then the specific case of weak dependencies that were present in older version of packages being upgrades, and were not met. Do we agree that it is a useful feature to have, irrespectively what the software can to today? If yes, the implementation in RHEL 9.0 should ideally be such which gets us furthermost towards this behaviour, even if in 9.0 it's not going to be exactly this behaviour. That should be the guiding principle for chosing one of the four (or some other) approach in 9.0. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (new packages: dnf), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:3957 |