Bug 2088422
| Summary: | dnf install should report an error when it cannot resolve the dependencies of a package to install, even when strict=False and best=True | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Andrew Schorr <ajschorr> |
| Component: | dnf | Assignee: | Jan Kolarik <jkolarik> |
| Status: | CLOSED ERRATA | QA Contact: | Tomáš Bajer <tbajer> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | medium | ||
| Version: | CentOS Stream | CC: | bstinson, james.antill, jkolarik, jwboyer, mbanas, mblaha, tbajer |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | dnf-4.14.0-1.el9 | Doc Type: | No Doc Update |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-09 08:18:18 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: | |||
Hm, this is strange. Either opendkim package is already installed - but in that case you should see a message like
# dnf install opendkim
Last metadata expiration check: 0:04:03 ago on Wed 25 May 2022 06:07:57 AM EDT.
Package opendkim-0:2.11.0-0.28.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
Or in case some of the requirements are not available, you should get exactly the message you wanted. Here is an example from centos stream 9 machine:
# dnf install opendkim
Last metadata expiration check: 0:06:57 ago on Wed 25 May 2022 06:07:57 AM EDT.
Error:
Problem: conflicting requests
- nothing provides libmilter.so.1.0()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64
- nothing provides libmemcached.so.11()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
I cannot reproduce the issue on CentosStream 9 though.
Can you check what repositories you have enabled (dnf repolist), whether opendkim is already installed (rpm -q opendkim) and from what repo the opendkim package is found (dnf repoquery opendkim --qf="%{name}-%{evr} %{repoid}")?
Ah. I see. The problem is because I added "strict=False" to /etc/dnf/dnf.conf.
Without strict=False:
[root@localhost ~]# dnf install opendkim
Extra Packages for Enterprise Linux 9 - x86_64 2.5 MB/s | 6.1 MB 00:02
Extra Packages for Enterprise Linux 9 - Next - x86_64 1.1 MB/s | 1.1 MB 00:00
Error:
Problem: conflicting requests
- nothing provides libmilter.so.1.0()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64
- nothing provides libmemcached.so.11()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
But with strict=False:
[root@localhost ~]# dnf install opendkim
Last metadata expiration check: 0:01:34 ago on Wed 25 May 2022 07:48:39 AM CDT.
Dependencies resolved.
Nothing to do.
Complete!
From the dnf.conf man page:
strict boolean
If disabled, all unavailable packages or packages with broken dependencies given to DNF command will be
skipped without raising the error causing the whole operation to fail. Currently works for install command
only. The default is True.
That is the behavior that I want (I don't want the operation to be aborted), but I would still like
to see the reasons for why it chooses not to install some of the packages. My vote would be to continue
to issue error messages even if strict=False is set, but simply don't abort the operation in that case.
Thanks,
Andy
I tried `dnf install zig -x lld-libs --setopt=strict=False` and it worked like expected (installin something with missing dependency). I believe that the investigation will require debugsolver data (use `--debugsolver`). There is one more config option that changes the behaviour - `best`: with best=false (Fedora default): # dnf install zlib-devel --exclude=pkgconf --setopt=strict=false --setopt=best=false Last metadata expiration check: 0:07:26 ago on Thu 26 May 2022 05:07:46 AM EDT. Dependencies resolved. Problem: package zlib-devel-1.2.11-33.el9.x86_64 requires /usr/bin/pkg-config, but none of the providers can be installed - package pkgconf-pkg-config-1.7.3-9.el9.x86_64 requires pkgconf(x86-64) = 1.7.3-9.el9, but none of the providers can be installed - cannot install the best candidate for the job - package pkgconf-1.7.3-9.el9.x86_64 is filtered out by exclude filtering ======================================================================================================================= Package Architecture Version Repository Size ======================================================================================================================= Skipping packages with broken dependencies: pkgconf-pkg-config x86_64 1.7.3-9.el9 baseos 11 k zlib-devel x86_64 1.2.11-33.el9 appstream 45 k Transaction Summary ======================================================================================================================= Skip 2 Packages Nothing to do. Complete! with best=true (RHEL default, applied also on Centos Stream 9 where the bug is reported): # dnf install zlib-devel --exclude=pkgconf --setopt=strict=false --setopt=best=true Last metadata expiration check: 0:07:33 ago on Thu 26 May 2022 05:07:46 AM EDT. Dependencies resolved. Nothing to do. Complete! Ah yes, that is correct. I hadn't considered playing with best=True because that's part of the default dnf.conf file. I guess that the problem is in condition in `output.py` in line 1183:
```
if not self.conf.best and self.base._goal.actions & forward_actions:
```
I guess that the condition is supposed to also test `self.conf.strict` whether is it `False`.
Following PRs were queued to fix this: fix: https://github.com/rpm-software-management/dnf/pull/1847 tests: https://github.com/rpm-software-management/ci-dnf-stack/pull/1151 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 (dnf bug fix and enhancement update), 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-2023:2490 |
Description of problem: When I run "dnf install opendkim", it says nothing to do without mentioning that it's unable to install the package due to missing dependencies. Version-Release number of selected component (if applicable): dnf-4.12.0-1.el9.noarch How reproducible: always Steps to Reproduce: 1. dnf install opendkim 2. 3. Actual results: [root@ti129 ~]# dnf install opendkim && echo YES Last metadata expiration check: 0:38:53 ago on Thu 19 May 2022 07:58:34 AM EDT. Dependencies resolved. Nothing to do. Complete! YES Expected results: Some kind of error message indicating that it cannot install the package due to missing dependencies. Such a message is produced when one runs "dnf download --resolve". Additional info: [root@ti129 ~]# dnf download --resolve opendkim Last metadata expiration check: 0:40:50 ago on Thu 19 May 2022 07:58:34 AM EDT. Error in resolve of packages: opendkim-2.11.0-0.28.el9.x86_64 Problem: conflicting requests - nothing provides libmilter.so.1.0()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64 - nothing provides libmemcached.so.11()(64bit) needed by opendkim-2.11.0-0.28.el9.x86_64