Bug 2013327

Summary: Install only newly recommended packages on upgrades with dnf/PackageKit/microdnf
Product: [Fedora] Fedora Reporter: Ben Cotton <bcotton>
Component: Changes TrackingAssignee: Jaroslav Mracek <jmracek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: bcotton, bog, hujq, katyaberezyaka, mhroncok, petersen, pnemade, stransky
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 14:41:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 2033130, 2042808, 2048394    
Bug Blocks: 1982279    

Description Ben Cotton 2021-10-12 15:22:27 UTC
This is a tracking bug for Change: Install only newly recommended packages on upgrades with dnf/PackageKit/microdnf
For more details, see: https://fedoraproject.org/wiki/Changes/ExcludeFromWeakAutodetect

We would like to change a default behavior dnf/PackageKit/microdnf to install only newly recommended packages on upgrades. Internally we will change exclude_from_weak_autodetect configuration option to True. exclude_from_weak_autodetect enables autodetection of unmet weak dependencies (Recommends or Supplements) of installed packages and blocks installation of packages satisfying already unmet dependencies. In other words: When you don't have the recommended package installed, it won't be automatically installed with future upgrades of the recommending package.

If you encounter a bug related to this Change, please do not comment here. Instead create a new bug and set it to block this bug.

Comment 1 Parag Nemade 2022-01-22 12:03:11 UTC
I need some help for this bug https://bugzilla.redhat.com/show_bug.cgi?id=2042808 I am not sure if its side-effect of this Change

Comment 2 Jens Petersen 2022-01-27 05:58:24 UTC
Ya, with the current implementation it seems weak deps are basically ignored now
unless you install the related packages together (ie in the same transaction).
I don't think that is the actual behavior that was suggested in bug 1699672.

To me the current new behavior (see bug 2042808) is as bad as the problem it was trying to solve (bug 1699672).

The new behavior should only apply to dnf update/upgrade, not dnf install.

(Failing that dnf would have to remember if a weak dep was removed explicitly.)

eg It is okay to ignore weak deps for `dnf update langpacks-fr` say
but it is not okay to ignore weak deps for `dnf install langpacks-fr` or `dnf reinstall langpacks-fr`.

Comment 3 Miro Hrončok 2022-02-04 13:00:19 UTC
The change has landed a long time ago but appears to misbehave. Adding several bug reports here for tracking purposes and changing to MODIFIED.

Comment 4 Jaroslav Mracek 2022-02-07 10:56:21 UTC
It looks like that the feature made a user case with langpacks broken. See additional reports:
Bug 2048394 - dnf should pull weak dependencies in install transaction
Bug 2033130 - exclude_from_weak_autodetect=true effectively renders rich weak dependencies useless
Bug 2042808 - weakdeps not working on rawhide system

The feature was requested:
Bug 2005305 - dnf should not pull (already unmet) weak dependencies on updates
Bug 1699672 - RFE: dnf should not pull (already broken) weak dependencies on updates

Firs of all I need to clarify that the feature cannot be implemented only on upgrades - because there are technical reasons for that - 
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.

Be honest I do not know what to do. Basically I see only 3 option with one additional:
1. Keep it like it is
2. Disable autodetection
3. Start to ignore rich dependencies for autodetection of unmet weak dependencies.
       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.

Comment 5 Miro Hrončok 2022-02-07 14:18:43 UTC
I've started https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/AVFZ725A56QL5GCIZZFCWUIPHJRUPBSR/ because you won't get any useful replies here.

Comment 6 Ben Cotton 2022-02-08 21:06:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 36 development cycle.
Changing version to 36.

Comment 7 Miro Hrončok 2022-02-10 09:42:14 UTC
(In reply to Miro Hrončok from comment #5)
> I've started
> https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/
> thread/AVFZ725A56QL5GCIZZFCWUIPHJRUPBSR/ because you won't get any useful
> replies here.

Whatever we decide to do, it appears to be too late for F36. We should revert the default option for F36 to be the same as F35 and make sure that happens before beta. Needinfoing Ben to handle tracking tris properly.

If you need fesco rubber-stamping this, feel free to open a ticket.

Comment 8 Ben Cotton 2022-02-10 14:33:18 UTC
I'm going to leave this tracker for F36 for the time being. Once the default has been reverted, I'll update it. In the meantime, I've nominated BZ 2033130 as an F36 Beta blocker to potentially track the reversion.

Comment 9 Ben Cotton 2022-02-22 16:34:15 UTC
We have reached the 'Change complete (100% complete)' deadline in the Fedora Linux 36 release schedule.

At this time, all Changes should be fully complete. Indicate this by setting this tracking bug to ON_QA.

If you need to defer this Change to a subsequent release, please needinfo me.

Comment 10 Jaroslav Mracek 2022-02-24 06:42:59 UTC
The feature is fully delivered (100%), we also delivered a patch that resolved recently discovered issue with the feature (Bug 2033130 - exclude_from_weak_autodetect=true effectively renders rich weak dependencies useless). I do not see any reason to postpone the feature.

Comment 11 Ben Cotton 2022-05-10 14:41:45 UTC
F36 was released today. If this Change did not land in the release, please notify bcotton as soon as possible.

Comment 12 Martin Stransky 2022-08-30 06:31:32 UTC
See Bug 2121959 - mozilla-openh264 is missing on fresh Fedora 36 install after dnf update so Firefox can't play H.264 content.