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 1780370 - versionlock plugin prevents installed packages being removed
Summary: versionlock plugin prevents installed packages being removed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf-plugins-core
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Marek Blaha
QA Contact: Jan Blazek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-05 19:43 UTC by Frank Hirtz
Modified: 2023-06-12 10:17 UTC (History)
2 users (show)

Fixed In Version: dnf-plugins-core-4.0.12-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:49:06 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-31608 0 None None None 2023-06-12 10:17:07 UTC
Red Hat Product Errata RHBA-2020:1823 0 None None None 2020-04-28 16:49:22 UTC

Description Frank Hirtz 2019-12-05 19:43:36 UTC
Description of problem:
Locking the version of a specific package prevents it being removed with "dnf remove" when a different version of that package is installed:

<snip>
[root@lab-rhel8-1 fmhirtz]# rpm -q bind-utils
bind-utils-9.11.4-26.P2.el8.x86_64
[root@lab-rhel8-1 fmhirtz]# cat /etc/dnf/plugins/versionlock.list

# Added locks on Thu Dec  5 17:18:33 2019
bind-utils-32:9.11.4-17.P2.el8_0.1.*
[root@lab-rhel8-1 fmhirtz]# yum remove bind-utils
Updating Subscription Management repositories.
No match for argument: bind-utils
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
</snip>


This behaviour is broken, and it did not exist on RHEL 7. It should be fixed.

Note that bind-utils above was used only as an example - the same problem exists for all packages.

We install our hosts in a completely automated way where all the install/upgrade/remove operations are performed in a single run of "dnf shell", so please do not suggest workarounds like editing the version lock file only after the old version of the package was already removed - such manual workarounds are unacceptable.

The root cause appears to be these lines in the versionlock plugin:

<snip>
        if locked_names:
            all_versions = self.base.sack.query().filter(name__glob=list(locked_names))
            other_versions = all_versions.difference(locked_query)
            excludes_query = excludes_query.union(other_versions)

        if excludes_query:
            self.base.sack.add_excludes(excludes_query)
</snip>

The above code makes all versions other than the one specified in the versionlock file invisible to _all_ package-related queries. But that is wrong, the "remove" operation must always see all installed versions (there may be more, e.g. in case of the kernel), so the exclusion should apply only to "install"/"upgrade".


Version-Release number of selected component (if applicable):
python3-dnf-plugin-versionlock-4.0.8-3.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Add/have versionlock entry for an installed package, but at a different version than the currently installed one 
2. Attempt to uninstall said package
3. 

Actual results:

dnf doesn't see the package and can't uninstall it

Expected results:

dnf should be able to uninstall the package

Additional info:

Comment 8 errata-xmlrpc 2020-04-28 16:49:06 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, 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-2020:1823


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