Bug 1832869 - 'dnf install' no longer updates packages
Summary: 'dnf install' no longer updates packages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.0
Assignee: Lukáš Hrázký
QA Contact: Eva Mrakova
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-07 12:29 UTC by adam winberg
Modified: 2020-11-04 01:53 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
.The default value for the `best` dnf configuration option has been changed from `True` to `False` With this update, the value for the `best` dnf configuration option has been set to `True` in the default configuration file to retain the original dnf behavior. As a result, for users that use the default configuration file the behavior remains unchanged. If you provide your own configuration files, make sure that the `best=True` option is present to retain the original behavior.
Clone Of:
Environment:
Last Closed: 2020-11-04 01:53:12 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:4510 0 None None None 2020-11-04 01:53:31 UTC

Description adam winberg 2020-05-07 12:29:21 UTC
Description of problem:
After update to 8.2 a 'dnf install <packageA>' no longer installs found updates for packageA, which it did before. 

This is breaking some of our build/deploy scripts and is an unexpected change in a minor release. I could not find any information about this in the release notes. 

Version-Release number of selected component (if applicable):
dnf-4.2.17-6.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Try to install an available update with 'dnf install <package>'


Actual results:
Dnf does not install any updates and outputs:
"Package <package> is already installed."


Expected results:
(Maybe not fully expected, but the way it was i RHEL7, RHEL8.0 and RHEL8.1)
Dnf detects and install the package update


Additional info:

Comment 1 Lukáš Hrázký 2020-05-21 11:50:09 UTC
Hello Adam,

it appears you don't have the "best" option set to true, which is what controls whether the `install` command will update packages to latest versions (as opposed to not upgrading, the way it behaves on Fedora).

Can you post the contents of your /etc/dnf/dnf.conf and whether it is a symlink to /etc/yum.conf?

Do you know which was the original version of RHEL with which this machine was installed and upgraded from?

Thanks!

Comment 2 adam winberg 2020-05-21 14:56:48 UTC
hm, thats weird. We have not changed the default setting for the 'best' option, which according to doc is 'true'. But if I add '--best' to my yum command in 8.2 the install command actually updates the package. And if I explicitly add 'best=True' to our dnf.conf it works as well. Has the default setting for 'best' changed in 8.2 without being documented?

/etc/yum.conf is a symlink pointing to /etc/dnf/dnf.conf. The contents are:

[main]
gpgcheck=1
localpkg_gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
metadata_expire=0
install_weak_deps=False
errorlevel=2
exit_on_lock=True

We see this on all machines updated to 8.2, from 8.1.

Comment 3 adam winberg 2020-05-26 11:47:44 UTC
Stumbled upon another change in behaviour which seems to trace back to the same problem. 

When trying to update a package with bad dependencies, in 8.2 the command behaves as if we have 'best=False'. But in 8.1 it behaves as if 'best=True'. The dnf.conf file is identical on both servers.

RHEL 8.1:
--------------------------------------------------------------
[root@lxserv1808:~]$ yum update --enablerepo=lx* 
...
...   
Error: 
 Problem: cannot install the best update candidate for package test-20200518-1.el8.x86_64
  - nothing provides fjak needed by test-20200526-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@lxserv1808:~]$ echo $?
1
[root@lxserv1808:~]$ 
--------------------------------------------------------------

RHEL 8.2:
--------------------------------------------------------------
[root@lxserv1908:~]$ /usr/bin/yum update 
...
...
===============================================================================================================================================================================================================================================
 Package                                                         Architecture                                                  Version                                                                  Repository                                                         Size
===============================================================================================================================================================================================================================================
Skipping packages with broken dependencies:
 test                                                        x86_64                                                        20200526-1.el8                                                           lxserv1908                                                        8.1 k

Transaction Summary
===============================================================================================================================================================================================================================================
Skip  1 Package

Nothing to do.
Complete!
[root@lxserv1908:~]$ echo $?
0
[root@lxserv1908:~]$ 
--------------------------------------------------------------

Comment 4 Lukáš Hrázký 2020-05-26 12:30:31 UTC
Yes, the default for the best value has changed from True to False between 8.1 and 8.2.

The best=True option setting has been shipped in dnf.conf since RHEL 8.0, but you do need to have it in your config to preserve the functionality.

Sorry about the inconvenience.

Comment 5 adam winberg 2020-05-26 12:34:13 UTC
Ok, easy for me to just add 'best=True' in my config. 

BUT why do you change a default setting in the middle of a RHEL lifecycle? And why is the change not even documented?
This is very unexpected from a minor release update.

Comment 21 errata-xmlrpc 2020-11-04 01:53:12 UTC
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 (yum 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/RHEA-2020:4510


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