Bug 2089579 - dnf does not honor exclude line in configuration file
Summary: dnf does not honor exclude line in configuration file
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-24 04:09 UTC by cornel panceac
Modified: 2023-05-25 18:53 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-25 18:53:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description cornel panceac 2022-05-24 04:09:26 UTC
Description of problem:
Tring to keep kernel 5.15.18 in my system i've added this line in dnf.conf:

exclude=kernel-5.15.18* kernel-core-5.15.18* kernel-devel-5.15.18*

Still, dnf update removed the desired kernel from the system.

Version-Release number of selected component (if applicable):
dnf-4.12.0-1.fc36.noarch


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
dnf does not remove the excluded package.

Additional info:
I want that specific version to be excluded because newer kernel are affected by a bug.

Comment 1 Pavla Kratochvilova 2022-05-31 13:06:46 UTC
Hello, the behavior of exclude is indeed strange for packages that are being removed. I suggest not to use exclude to protect packages from being removed. You can use dnf versionlock plugin (https://dnf-plugins-core.readthedocs.io/en/latest/versionlock.html) that is part of dnf-plugins-core and lock to a kernel-5.15.18 to forbid upgrades to newer versions. Another option is to use exclude for all kernels, but I think versionlock is better suited for your use case.

---

As for the behavior of exclude:

For packages that are not installonly, excluding the package that would be replaced by the upgrade works, but doesn't provide very good message:

# dnf upgrade dnf --exclude dnf-4.11.1
Package dnf available, but not installed
No match for argument: dnf
Error: No packages marked for upgrade

(With dnf-4.11.1-2.fc36 installed)

But for installonly package, like kernel, it doesn't work unless all the installed kernels are excluded.

Comment 2 Ben Cotton 2023-04-25 17:14:00 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Ludek Smid 2023-05-25 18:53:46 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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