What were you trying to do that didn't work?
When multiple versions of an installonly package (e.g., kernel-devel) are installed in a single DNF transaction, and a dnf history rollback is subsequently performed to revert to a state before this installation, DNF4 only removes the latest version from that set of installed packages. Other installonly packages from that same transaction remain on the system.
What is the impact of this issue to you?
Please provide the package NVR for which the bug is seen:
dnf-0:4.14.0-25.el9
How reproducible is this bug?:
Steps to reproduce
- Setup: Use a RHEL 9.x system (e.g., RHEL 9.6 as initially mentioned, though any RHEL 9 with DNF4 should suffice).
- Initial State: Note the latest DNF history ID. Let this be ID_BEFORE_INSTALL.
dnf history - Add repositories: Add /etc/yum.repos.d/kernel-devel-test.repo
[upgrade-BaseOS-91] name=upgrade-BaseOS-91 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.1/compose/BaseOS/$basearch/os/ enabled=1 gpgcheck=0 [upgrade-AppStream-91] name=upgrade-AppStream-91 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.1/compose/AppStream/$basearch/os/ enabled=1 gpgcheck=0 [upgrade-BaseOS-92] name=upgrade-BaseOS-92 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.2/compose/BaseOS/$basearch/os/ enabled=1 gpgcheck=0 [upgrade-AppStream-92] name=upgrade-AppStream-92 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.2/compose/AppStream/$basearch/os/ enabled=1 gpgcheck=0 [upgrade-BaseOS-93] name=upgrade-BaseOS-93 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.3/compose/BaseOS/$basearch/os/ enabled=1 gpgcheck=0 [upgrade-AppStream-93] name=upgrade-AppStream-93 baseurl=http://download.eng.brq.redhat.com/rhel-9/rel-eng/RHEL-9/latest-RHEL-9.3/compose/AppStream/$basearch/os/ enabled=1 gpgcheck=0
- Install Multiple installonly Packages: In a single transaction, install multiple versions/releases of an installonly package. For example, using kernel-devel (assuming these versions are available in configured repositories):
dnf install kernel-devel-5.14.0-162.6.1.el9_1.x86_64 kernel-devel-5.14.0-284.11.1.el9_2.x86_64 kernel-devel-5.14.0-362.8.1.el9_3 - Perform Rollback: Attempt to roll back to the state before the installation in step 3: dnf history rollback ID_BEFORE_INSTALL
- Observe: Check which kernel-devel packages remain on the system.
Expected results
When dnf history rollback ID_BEFORE_INSTALL is executed, DNF should remove all installonly packages that were installed in the single transaction being reverted. The system's package state should fully revert to how it was at ID_BEFORE_INSTALL with respect to these packages.
Actual results
DNF only removes the newest version/release of the installonly package that was part of the multi-install transaction. The older installonly package(s) from that same transaction incorrectly remain installed on the system.
Note:
Reproducible even for kernel-devel packages with different versions (not just different release numbers)