Bug 1306057 - [UX] different behaviour of installonly in yum/dnf
Summary: [UX] different behaviour of installonly in yum/dnf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-10 00:06 UTC by Trevor Cordes
Modified: 2016-04-13 07:21 UTC (History)
6 users (show)

Fixed In Version: dnf-1.1.8-1.fc24 dnf-1.1.8-1.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-13 07:21:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Trevor Cordes 2016-02-10 00:06:11 UTC
Description of problem:
Attempted a simple dnf update today on one of my boxes:
#dnf update
Last metadata expiration check performed 0:22:20 ago on Tue Feb  9 17:30:38 2016.
Dependencies resolved.
Error: The operation would result in removing the booted kernel: kernel-core-4.2.8-200.fc22.i686.

Never seen that before.

#rpm -q kernel
kernel-4.2.6-201.fc22.i686
kernel-4.2.8-200.fc22.i686

Why is dnf trying to get rid of 4.2.8 when it should be installing the newest one, and removing NONE because I have installonly_limit=3.

This box was yum upgraded (dist-sync) from 21 to 22 a few months ago, but so were a dozen other boxes I have and they aren't showing this behaviour (but they are almost all x64, not i686).

It gets weirder.  Here's my dnf.conf:
[main]
gpgcheck=1
installonly_limit=3
installonlypkgs=kernel-PAE kernel-PAE-core kernel-PAE-modules
clean_requirements_on_remove=true

The -PAE installonlypkgs should be irrelevant on this box which is not PAE and has no PAE installed:

#rpm -q kernel-PAE
package kernel-PAE is not installed

I use a standardized dnf.conf for all my boxes, so that is why installonlypkgs is set that way.  It never hurt things in the past (we're talking 10 years here).

Watch this weirdness: change dnf.conf installonlypkgs to:
installonlypkgs=kernel-PAE kernel-PAE-core kernel-PAE-modules kernel kernel-core kernel-modules

And now dnf update works fine (and does the right thing)!  Or, change dnf.conf to comment out installonlypkgs completely:
#installonlypkgs=kernel-PAE kernel-PAE-core kernel-PAE-modules

And now dnf update works fine.

So something in dnf is getting confused with regards to the kernel and installonlypkgs even when installonlypkgs is set to packages that aren't even relevant to this system.  It's like my dnf.conf installonlypkgs setting is overriding some default list of installonlypkgs?  One would think my installonlypkgs setting would *add* to whatever packages the system deems install-only (like kernels).

This seems related to the problem I've had with yum and dnf on my -PAE boxes for years documented in this bug #1199715 that no one has ever looked at.

All my boxes get yum (soon dnf) upgraded (dist-sync) from version to version every few months.  Perhaps this is the key that causing some sort of install-only-kernel confusion.


Version-Release number of selected component (if applicable):
dnf-1.1.5-1.fc22.noarch
kernel-4.2.8-200.fc22.i686


How reproducible:
Always


Steps to Reproduce:
1. set line in dnf.conf 
2. installonlypkgs=kernel-PAE kernel-PAE-core kernel-PAE-modules
3. dnf update

Actual results:
Error: The operation would result in removing the booted kernel: kernel-core-4.2.8-200.fc22.i686.


Expected results:
[updates as expected, new kernel gets installed, not updated]

Comment 1 Steve 2016-02-10 02:05:56 UTC
(In reply to Trevor Cordes from comment #0)
...
> It's like my dnf.conf installonlypkgs setting
> is overriding some default list of installonlypkgs?  One would think my
> installonlypkgs setting would *add* to whatever packages the system deems
> install-only (like kernels).
...

Apparently, the "installonlypkgs" option completely *replaces* the default list. The documentation should state that explicitly:
$ man dnf.conf

The default list appears to be configured here:
$ grep kernel dnf-1.1.6/dnf/const.py.in 
INSTALLONLYPKGS=('kernel',
                 'installonlypkg(kernel)',
                 'installonlypkg(kernel-module)',

Comment 2 Steve 2016-02-10 02:16:57 UTC
(In reply to Steve from comment #1)
...
> The default list appears to be configured here:
...

Dnf is implemented in Python, so you can see the default list in your installed system:
$ grep -n kernel /usr/lib/python*/site-packages/dnf/const.py

Comment 3 Trevor Cordes 2016-02-10 10:42:26 UTC
I'm pretty sure yum didn't behave that way, as I never had this problem with yum (and I may be wrong but dnf is supposed to try to emulate yum behaviour as much as possible?).

I guess we'll leave this bug open as a documentation bug?  Or should the behaviour be changed back to the old yum way?

Also, if you get a chance to check my bug #1199715 that would be great too!  Ahh!  Looks like it's the same source code setting!  That list doesn't include kernel-PAE!!  Can you check that bz and see if we can get that fixed now that we know if would be super easy!  And why not add kernel-core to that list now too?  (3 rpm's per kernel install total.)

Thanks!

I'm shocked I seem to be the only person in the world using kernel-PAE in Fedora for several years...

Comment 4 Steve 2016-02-10 12:23:45 UTC
Hi, Trevor. I'm not a developer, so I was simply providing some additional information found by reading the documentation and grepping the code. In addition to the documentation saying what the default installonlypkgs list contains, the dnf log file should also record the list. In any case, the installed installonly packages can be found with:

$ dnf repoquery --installonly # See: man dnf.plugin.repoquery

> ... dnf is supposed to try to emulate yum behaviour as much as possible?

See: man yum2dnf

Comment 5 Steve 2016-02-12 03:11:34 UTC
(In reply to Steve from comment #4)
...
> In addition to the documentation saying what the default installonlypkgs list
> contains, the dnf log file should also record the list.
...

The list can be obtained this way:

$ dnf config-manager --dump | grep installonlypkgs
installonlypkgs = ('kernel', 'installonlypkg(kernel)', 'installonlypkg(kernel-module)', 'installonlypkg(vm)')

See: man dnf.plugin.config_manager

Comment 6 Michal Luscon 2016-02-15 12:52:17 UTC
Ok, we will document the difference and the rest of bugreport is tracked by #1308515.

Comment 7 Fedora Update System 2016-04-06 14:38:27 UTC
dnf-plugins-core-0.1.20-1.fc24 dnf-1.1.8-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-5dae5d2add

Comment 8 Fedora Update System 2016-04-07 10:01:58 UTC
dnf-1.1.8-1.fc23 dnf-plugins-core-0.1.20-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-ddeabfcfe6

Comment 9 Fedora Update System 2016-04-07 16:54:12 UTC
dnf-1.1.8-1.fc24, dnf-plugins-core-0.1.20-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5dae5d2add

Comment 10 Fedora Update System 2016-04-08 16:59:02 UTC
dnf-1.1.8-1.fc24, dnf-plugins-core-0.1.20-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2016-04-08 20:51:21 UTC
dnf-1.1.8-1.fc23, dnf-plugins-core-0.1.20-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-ddeabfcfe6

Comment 12 Fedora Update System 2016-04-13 07:21:30 UTC
dnf-1.1.8-1.fc23, dnf-plugins-core-0.1.20-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


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