Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected kernel removal in the transaction #2127

Open
m-blaha opened this issue Mar 12, 2025 · 0 comments
Open

Unexpected kernel removal in the transaction #2127

m-blaha opened this issue Mar 12, 2025 · 0 comments
Assignees
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@m-blaha
Copy link
Member

m-blaha commented Mar 12, 2025

If the number of installed kernels exceeds the installonly_limit, any DNF transaction - even those that do not involve the kernel package - will result in the removal of excess kernels. This behavior is unexpected and it's a regression comparing to dnf4.

❯ rpm -q kernel
kernel-6.13.4-100.fc40.x86_64
kernel-6.13.5-100.fc40.x86_64
kernel-6.8.5-301.fc40.x86_64

❯ dnf --dump-main-config | grep installonly_limit
installonly_limit = 3

Let's lower installonly_limit config option and try to install a random package:

❯ dnf5 --assumeno --setopt=installonly_limit=2 install acpi
Package                     Arch     Version                     Repository          Size
Removing:
 kernel                     x86_64   6.8.5-301.fc40              fedora           0.0   B
 kernel-core                x86_64   6.8.5-301.fc40              fedora          66.4 MiB
 kernel-modules             x86_64   6.8.5-301.fc40              fedora          58.0 MiB
 kernel-modules-core        x86_64   6.8.5-301.fc40              fedora          32.4 MiB
Installing:
 acpi                       x86_64   1.7-23.fc40                 fedora          47.5 KiB

Transaction Summary:
 Installing:         1 package
 Removing:           4 packages

Total size of inbound packages is 27 KiB. Need to download 27 KiB.
After this operation, 157 MiB will be freed (install 47 KiB, remove 157 MiB).
Operation aborted by the user.

With dnf4 everything behaves as expected:

❯ dnf4 --assumeno --setopt=installonly_limit=2 install acpi
Dependencies resolved.
=========================================================================================
 Package          Architecture       Version                    Repository          Size
=========================================================================================
Installing:
 acpi             x86_64             1.7-23.fc40                fedora              27 k

Transaction Summary
=========================================================================================
Install  1 Package

Total size: 27 k
Installed size: 47 k
Operation aborted.

I believe DNF should remove excess installonly package versions only when the package name itself is part of the transaction (or even inbound part of the transaction).

Related Fedora bug: https://bugzilla.redhat.com/show_bug.cgi?id=2350483

@kontura kontura self-assigned this Mar 13, 2025
@pkratoch pkratoch added Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

No branches or pull requests

3 participants