kernel autoremove not working

Bug #1605160 reported by Hadmut Danisch
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Confirmed
High
Unassigned

Bug Description

On one 16.04 machine I have 5 4.4.0-kernels in /boot now (on another machine even 6):

-rw------- 1 root root 7013968 Apr 19 00:21 vmlinuz-4.4.0-21-generic
-rw------- 1 root root 7015440 Mai 13 01:55 vmlinuz-4.4.0-22-generic
-rw------- 1 root root 7020176 Jun 8 23:39 vmlinuz-4.4.0-24-generic
-rw------- 1 root root 7026864 Jun 24 14:03 vmlinuz-4.4.0-28-generic
-rw------- 1 root root 7047504 Jul 13 03:59 vmlinuz-4.4.0-31-generic

Should not hapen that way. apt-get autoremove should clean that, but doesn't.

regards

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.12~ubuntu16.04.1
ProcVersionSignature: Ubuntu 4.4.0-31.50-generic 4.4.13
Uname: Linux 4.4.0-31-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Thu Jul 21 11:41:43 2016
InstallationDate: Installed on 2016-04-22 (89 days ago)
InstallationMedia: Lubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hadmut Danisch (hadmut) wrote :
Revision history for this message
David Kalnischkies (donkult) wrote :

Are you sure you haven't marked these kernels as manually installed somehow? Perhaps there is also something depending on them still like some installed out-of-tree kernel modules.

The output of the following three commands can be helpful to figure out if apt would consider autoremoving them if nothing else would block them:

apt-mark showauto ^linux-image-.*
apt-mark showmanual ^linux-image-.*
cat /etc/apt/apt.conf.d/01autoremove-kernels

Revision history for this message
Hadmut Danisch (hadmut) wrote :
Download full text (3.9 KiB)

Definitely no manual interaction, fresh install recently.

# apt-mark showauto ^linux-image-.*
linux-image-4.4.0-21-generic
linux-image-4.4.0-22-generic
linux-image-4.4.0-24-generic
linux-image-4.4.0-28-generic
linux-image-4.4.0-31-generic
linux-image-extra-4.4.0-28-generic
linux-image-extra-4.4.0-31-generic
linux-image-generic

# apt-mark showmanual ^linux-image-.*

(no output..)

# cat /etc/apt/apt.conf.d/01autoremove-kernels
// DO NOT EDIT! File autogenerated by /etc/kernel/postinst.d/apt-auto-removal
APT::NeverAutoRemove
{
   "^linux-image-4\.4\.0-28-generic$";
   "^linux-image-4\.4\.0-31-generic$";
   "^linux-headers-4\.4\.0-28-generic$";
   "^linux-headers-4\.4\.0-31-generic$";
   "^linux-image-extra-4\.4\.0-28-generic$";
   "^linux-image-extra-4\.4\.0-31-generic$";
   "^linux-signed-image-4\.4\.0-28-generic$";
   "^linux-signed-image-4\.4\.0-31-generic$";
   "^kfreebsd-image-4\.4\.0-28-generic$";
   "^kfreebsd-image-4\.4\.0-31-generic$";
   "^kfreebsd-headers-4\.4\.0-28-generic$";
   "^kfreebsd-headers-4\.4\.0-31-generic$";
   "^gnumach-image-4\.4\.0-28-generic$";
   "^gnumach-image-4\.4\.0-31-generic$";
   "^.*-modules-4\.4\.0-28-generic$";
   "^.*-modules-4\.4\.0-31-generic$";
   "^.*-kernel-4\.4\.0-28-generic$";
   "^.*-kernel-4\.4\.0-31-generic$";
   "^linux-backports-modules-.*-4\.4\.0-28-generic$";
   "^linux-backports-modules-.*-4\.4\.0-31-generic$";
   "^linux-tools-4\.4\.0-28-generic$";
   "^linux-tools-4\.4\.0-31-generic$";
};
/* Debug information:
# dpkg list:
ii linux-image-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-24-generic 4.4.0-24.43 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-28-generic 4.4.0-28.47 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-31-generic 4.4.0-31.50 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-22-generic 4.4.0-22.40 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc linux-image-extra-4.4.0-24-generic 4.4.0-24.43 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-28-generic 4.4.0-28.47 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-31-generic 4....

Read more...

Revision history for this message
David Kalnischkies (donkult) wrote :

So apt would autoremove them if it could, like it already did with the linux-image-extra packages – so I guess as before: kernel module package depending on the images perhaps via indirection (provides), probably on of the "NonfreeKernelModules: zfs zunicode zcommon znvpair zavl" (or another, I am not sure this really list all modules). In that case it works as "intended".

Revision history for this message
thermoman (thermoman) wrote :

Do you have by any chance virtualbox installed? Please see my bug #1636203

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
thermoman (thermoman) wrote :

I see

> NonfreeKernelModules: zfs zunicode zcommon znvpair zavl

in your report. It might have something to do with packages that install extra kernel modules ultimately preventing autoremoval of the old kernel images. ZFS in your case, virtualbox in my case.

Revision history for this message
thermoman (thermoman) wrote :

bug #1472351 seems to be the cause for this issue. I guess you have some ZFS package installed that has a Recommends tag for linux-headers or linux-image, too.

Changed in apt (Ubuntu):
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.