Bug 1266938 - dnf autoremove wants to remove kernel among other intentionally installed packages
Summary: dnf autoremove wants to remove kernel among other intentionally installed pac...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: x86_64
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: 2015-09-28 15:25 UTC by Flo H.
Modified: 2016-04-05 19:43 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-15 08:05:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Output dnf autoremove (2.49 KB, text/plain)
2015-09-28 15:25 UTC, Flo H.
no flags Details
dnf history userinstalled (179 bytes, text/plain)
2015-09-28 15:27 UTC, Flo H.
no flags Details

Description Flo H. 2015-09-28 15:25:35 UTC
Created attachment 1077953 [details]
Output dnf autoremove

Description of problem:

When executing `dnf autoremove`, dnf intends to remove the following packages:

 alacarte                            noarch   3.11.91-2.fc21    @System   369 k
 audacious-plugins-jack              x86_64   3.6.2-1.fc22      @System    20 k
 dnf-plugin-system-upgrade           noarch   0.4.1-1.fc22      @System    78 k
 kernel                              x86_64   4.1.6-201.fc22    @System     0  
 kernel-core                         x86_64   4.1.6-201.fc22    @System    42 M
 kernel-devel                        x86_64   4.1.6-201.fc22    @System    36 M
 kernel-devel                        x86_64   4.1.7-200.fc22    @System    36 M
 kernel-modules                      x86_64   4.1.6-201.fc22    @System    17 M
 kernel-modules-extra                x86_64   4.1.6-201.fc22    @System   2.1 M
 libipa_hbac                         x86_64   1.13.0-4.fc22     @System    53 k
 libsss_idmap                        x86_64   1.13.0-4.fc22     @System    65 k
 libsss_nss_idmap                    x86_64   1.13.0-4.fc22     @System    61 k
 python2-dnf-plugin-system-upgrade   noarch   0.4.1-1.fc22      @System    52 k
 python3-sssdconfig                  noarch   1.13.0-4.fc22     @System   214 k
 sssd                                x86_64   1.13.0-4.fc22     @System    34 k
 sssd-ad                             x86_64   1.13.0-4.fc22     @System   482 k
 sssd-client                         x86_64   1.13.0-4.fc22     @System   206 k
 sssd-common                         x86_64   1.13.0-4.fc22     @System   3.1 M
 sssd-common-pac                     x86_64   1.13.0-4.fc22     @System   151 k
 sssd-ipa                            x86_64   1.13.0-4.fc22     @System   483 k
 sssd-krb5                           x86_64   1.13.0-4.fc22     @System    76 k
 sssd-krb5-common                    x86_64   1.13.0-4.fc22     @System   224 k
 sssd-ldap                           x86_64   1.13.0-4.fc22     @System   149 k
 sssd-proxy                          x86_64   1.13.0-4.fc22     @System   129 k
 strace                              x86_64   4.10-2.fc22       @System   1.2 M

None of these packages should be removed. Kernel the least. Among this list there are packages such as strace and alacarte that I installed using dnf install, even though dnf history userinstalled doesn't show it.
Here is the output of dnf history userinstalled
Packages installed by user
kernel
kernel-core
kernel-modules
kernel-modules-extra
pithos
rpmconf

I don't understand why kernel* is listed here...


Version-Release number of selected component (if applicable):
dnf 1.1.1-2.fc22


How reproducible:
100% on my system.

Steps to Reproduce:
1. dnf autoremove
2.
3.

Actual results:


Expected results:
Not to remove kernel, and none of the packages that I installed using dnf install ..., and not sssd*.

Additional info:

Comment 1 Flo H. 2015-09-28 15:27:22 UTC
Created attachment 1077957 [details]
dnf history userinstalled

Comment 2 Flo H. 2015-10-05 15:55:05 UTC
.

Comment 3 Jaroslav Mracek 2015-10-13 13:24:37 UTC
Please did you upgraded from dnf 0.6 or it is from Fedora 22 installation? Please could you provide log from 'rpm -q kernel*' and 'dnf history userinstalled' ?

You can fix it by your self with command 'dnf mark kernel*'

Comment 4 Flo H. 2015-10-13 15:58:07 UTC
@Jaroslav Mracek:
-dnf is the package that is shipped with Fedora 22 (no manual upgrade to newer version or so).
-'dnf history userinstalled' is attached above in "Comment 1". I am not sure the content of this file is correct. It has entries like "kernel" and "kernel-core" and I am missing other packages that I really installed manually.
-'sudo rpm -q kernel*' outputs the following "package kernel* is not installed" 
-'sudo rpm -q kernel' outputs the following "kernel-4.1.7-200.fc22.x86_64
kernel-4.1.8-200.fc22.x86_64
kernel-4.1.10-200.fc22.x86_64"


Hope that helps.

Comment 5 Flo H. 2015-10-13 16:01:49 UTC
@Jaroslav Mracek: Regarding the suggested fix: Do you mean marking the package as userinstalled ('dnf mark install kernel*') or unmark it as user-installed ('dnf mark remove kernel*')?

Comment 6 Flo H. 2015-10-13 16:09:53 UTC
After unmarking "kernel-*" as user-installed ('dnf mark remove kernel-*'), none of the kernel packages should be removed when running 'dnf autoremove' however kernel is listed there with a package size of 0.
What about the other packages that dnf wants to remove (esp. sssd*)?


Output 'dnf mark remove kernel-*':
kernel-4.1.7-200.fc22.x86_64 unmarked as user installed.
kernel-4.1.8-200.fc22.x86_64 unmarked as user installed.
kernel-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-core-4.1.7-200.fc22.x86_64 unmarked as user installed.
kernel-core-4.1.8-200.fc22.x86_64 unmarked as user installed.
kernel-core-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-devel-4.1.7-200.fc22.x86_64 unmarked as user installed.
kernel-devel-4.1.8-200.fc22.x86_64 unmarked as user installed.
kernel-devel-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-headers-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-modules-4.1.7-200.fc22.x86_64 unmarked as user installed.
kernel-modules-4.1.8-200.fc22.x86_64 unmarked as user installed.
kernel-modules-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-modules-extra-4.1.7-200.fc22.x86_64 unmarked as user installed.
kernel-modules-extra-4.1.8-200.fc22.x86_64 unmarked as user installed.
kernel-modules-extra-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-tools-4.1.10-200.fc22.x86_64 unmarked as user installed.
kernel-tools-libs-4.1.10-200.fc22.x86_64 unmarked as user installed.

Output 'dnf autoremove':
================================================================================
 Package                            Arch    Version             Repository
                                                                           Size
================================================================================
Removing:
 alacarte                           noarch  3.11.91-2.fc21      @fedora   369 k
 audacious-plugins-jack             x86_64  3.6.2-1.fc22        @updates   20 k
 dnf-plugin-system-upgrade          noarch  0.4.1-1.fc22        @updates   78 k
 kernel                             x86_64  4.1.10-200.fc22     @updates    0  
 kernel                             x86_64  4.1.7-200.fc22      @updates    0  
 kernel                             x86_64  4.1.8-200.fc22      @updates    0  
 libipa_hbac                        x86_64  1.13.0-4.fc22       @updates   53 k
 libsss_idmap                       x86_64  1.13.0-4.fc22       @updates   65 k
 libsss_nss_idmap                   x86_64  1.13.0-4.fc22       @updates   61 k
 python2-dnf-plugin-system-upgrade  noarch  0.4.1-1.fc22        @updates   52 k
 python3-sssdconfig                 noarch  1.13.0-4.fc22       @updates  214 k
 sssd                               x86_64  1.13.0-4.fc22       @updates   34 k
 sssd-ad                            x86_64  1.13.0-4.fc22       @updates  482 k
 sssd-client                        x86_64  1.13.0-4.fc22       @updates  206 k
 sssd-common                        x86_64  1.13.0-4.fc22       @updates  3.1 M
 sssd-common-pac                    x86_64  1.13.0-4.fc22       @updates  151 k
 sssd-ipa                           x86_64  1.13.0-4.fc22       @updates  483 k
 sssd-krb5                          x86_64  1.13.0-4.fc22       @updates   76 k
 sssd-krb5-common                   x86_64  1.13.0-4.fc22       @updates  224 k
 sssd-ldap                          x86_64  1.13.0-4.fc22       @updates  149 k
 sssd-proxy                         x86_64  1.13.0-4.fc22       @updates  129 k

Transaction Summary
================================================================================
Remove  21 Packages

Installed size: 5.9 M

Comment 7 Jaroslav Mracek 2015-10-14 09:01:37 UTC
Please try 'dnf mark install kernel*'. If packages are mark as userinstalled they will be not removed by autoremove command.

Comment 8 Flo H. 2015-10-14 19:22:37 UTC
After doing that, DNF doesn't want to remove any kernel package anymore when executing 'dnf autoremove'. That workaround works even though I don't like it.

Any idea why dnf wants to the other packages listed above in "Comment 6"?

Thanks for your support!!

Comment 9 Jaroslav Mracek 2015-10-15 08:05:23 UTC
This problem (incorrect package label) was reported for some older versions of dnf and it was fixed. Unfortunately, after install of newer dnf version, the labels remain.

Comment 10 Flo H. 2015-10-15 13:17:20 UTC
Does that mean that label all packages that DNF wants to autremove should be labeled user-installed manually?

Comment 11 Jaroslav Mracek 2015-10-16 09:06:53 UTC
Auto Remove Command

dnf [options] autoremove

    Removes all “leaf” packages from the system that were originally installed as dependencies of user-installed packages but which are no longer required by any such package.

Packages listed in installonlypkgs are never automatically removed by this command (kernel ...).

Comment 12 Flo H. 2015-10-16 19:16:57 UTC
I know, and that's why I think it is a bug if I have to manually mark kernel packages as userinstalled to prevent DNF from removing them.
(Actually not only kernel packages, the others that DNF want to remove are in fact userinstalled using dnf....)


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