RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1926261 - dnf should not allow an installonly_limit less than 2
Summary: dnf should not allow an installonly_limit less than 2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Marek Blaha
QA Contact: Jan Blazek
URL:
Whiteboard:
Depends On: 1951409 1951411
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-08 14:16 UTC by jcastran
Modified: 2024-03-25 18:08 UTC (History)
4 users (show)

Fixed In Version: dnf-4.7.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:52:36 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5784861 0 None None None 2021-02-08 14:16:13 UTC
Red Hat Product Errata RHSA-2021:4464 0 None None None 2021-11-09 19:53:12 UTC

Description jcastran 2021-02-08 14:16:14 UTC
Description of problem:
When the installonly_limit is set to 1, dnf fails to update the kernel and does not clearly indicate why. DNF should not allow for an installonly_limit of 1

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

How reproducible:
Everytime

Steps to Reproduce:
1. Have a kernel update available or install a lower kernel
2. # yum update kernel --setopt=installonly_limit=1
3.

Actual results:
Error:
 Problem: The operation would result in removing the following protected packages: kernel-core
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)


Expected results:
yum/dnf prevents the installonly_limit being set less than 2. 


Additional info:
RHEL 7 implemented this in 2008

https://github.com/rpm-software-management/yum/commit/b31133149f5b25e0fb01d6bfa07f4d6f699c9142

When this is set on RHEL 7, yum stops you.

Options error: Error parsing "installonly_limit = '1'": out of range integer value

Comment 1 Marek Blaha 2021-02-16 08:54:24 UTC
According to `man dnf.conf` (see https://dnf.readthedocs.io/en/latest/conf_ref.html#installonly-limit-label for a html version) values 0 or 1 in installonly_limit configuration option means that unlimited number of installonly packages is being kept. Apparently, due to a bug in dnf only value 0 is accepted as such.
Is fixing the dnf to behave according the documentation acceptable solution? I.e. if installonly_limit is 1, no error is raised and dnf allows any number of kernels installed.

Comment 2 Marek Blaha 2021-02-17 09:09:49 UTC
The other option of fixing it is what you actually proposed - change the documentation that 1 is not allowed value and raise similar error as RHEL 7 did.

Comment 3 jcastran 2021-02-17 12:58:29 UTC
My vote is to change the documentation and not allow a value of 1. 

This would prevent cases where it was assumed 1 meant only 1 kernel is allowed and they inevitably run out of space in /boot. Better to allow 0 to be unlimited, but make 1 output a message telling them they can't do that.

Comment 5 Marek Blaha 2021-03-05 15:59:03 UTC
PR that disallows installonly_limit=1 configuration option - https://github.com/rpm-software-management/libdnf/pull/1155
PR that changes documentation accordingly and prints the warning to the user - https://github.com/rpm-software-management/dnf/pull/1740

Comment 6 Marek Blaha 2021-03-05 16:10:40 UTC
PR with test: https://github.com/rpm-software-management/ci-dnf-stack/pull/970

Comment 16 errata-xmlrpc 2021-11-09 19:52:36 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 (Moderate: dnf security and bug fix 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/RHSA-2021:4464


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