Bug 1266938 - dnf autoremove wants to remove kernel among other intentionally installed packages
dnf autoremove wants to remove kernel among other intentionally installed pac...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-28 11:25 EDT by Flo H.
Modified: 2016-04-05 15:43 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-15 04:05:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Flo H. 2015-09-28 11:25:35 EDT
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 11:27 EDT
Created attachment 1077957 [details]
dnf history userinstalled
Comment 2 Flo H. 2015-10-05 11:55:05 EDT
.
Comment 3 Jaroslav Mracek 2015-10-13 09:24:37 EDT
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 11:58:07 EDT
@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 12:01:49 EDT
@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 12:09:53 EDT
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 05:01:37 EDT
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 15:22:37 EDT
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 04:05:23 EDT
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 09:17:20 EDT
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 05:06:53 EDT
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 15:16:57 EDT
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.