Kernel package complains that headers do not exist during uninstall

Bug #1697376 reported by Dan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I have updated my kernel package to the latest version last week, and today I ran `sudo apt autoremove` to remove the older kernel version (version 4.10.0-20). However during the removal process, it complained that the headers for kernel 4.10.0-20-generic cannot be found (which is the package I removed) with the following error message (The error messaged appeared twice):

> Error! Your kernel headers for kernel 4.10.0-20-generic cannot be found.
> Please install the linux-headers-4.10.0-20-generic package,
> or use the --kernelsourcedir option to tell DKMS where it's located

I do however think the removal process was successful.

Ubuntu 17.04
Latest installed kernel: 4.10.0-22-generic

$ uname -a
Linux KWRD-laptop-91 4.10.0-22-generic #24-Ubuntu SMP Mon May 22 17:43:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

This is the `apt` output of the autoremove command:

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-4.10.0-20 linux-headers-4.10.0-20-generic linux-image-4.10.0-20-generic linux-image-extra-4.10.0-20-generic linux-signed-image-4.10.0-20-generic
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 307 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 383493 files and directories currently installed.)
Removing linux-headers-4.10.0-20-generic (4.10.0-20.22) ...
Removing linux-headers-4.10.0-20 (4.10.0-20.22) ...
Removing linux-signed-image-4.10.0-20-generic (4.10.0-20.22) ...
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-22-generic
Found initrd image: /boot/initrd.img-4.10.0-22-generic
Found linux image: /boot/vmlinuz-4.10.0-21-generic
Found initrd image: /boot/initrd.img-4.10.0-21-generic
Found linux image: /boot/vmlinuz-4.10.0-20-generic
Found initrd image: /boot/initrd.img-4.10.0-20-generic
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-extra-4.10.0-20-generic (4.10.0-20.22) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
Error! Your kernel headers for kernel 4.10.0-20-generic cannot be found.
Please install the linux-headers-4.10.0-20-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.10.0-20-generic cannot be found.
Please install the linux-headers-4.10.0-20-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-22-generic
Found initrd image: /boot/initrd.img-4.10.0-22-generic
Found linux image: /boot/vmlinuz-4.10.0-21-generic
Found initrd image: /boot/initrd.img-4.10.0-21-generic
Found linux image: /boot/vmlinuz-4.10.0-20-generic
Found initrd image: /boot/initrd.img-4.10.0-20-generic
Adding boot menu entry for EFI firmware configuration
done
Removing linux-image-4.10.0-20-generic (4.10.0-20.22) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
dkms: removing: bbswitch 0.8 (4.10.0-20-generic) (x86_64)

-------- Uninstall Beginning --------
Module: bbswitch
Version: 0.8
Kernel: 4.10.0-20-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

bbswitch.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.10.0-20-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
update-initramfs: Deleting /boot/initrd.img-4.10.0-20-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.10.0-22-generic
Found initrd image: /boot/initrd.img-4.10.0-22-generic
Found linux image: /boot/vmlinuz-4.10.0-21-generic
Found initrd image: /boot/initrd.img-4.10.0-21-generic
Adding boot menu entry for EFI firmware configuration
done

Output of `sudo apt install -f`:

$ sudo apt install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Output of `ls -l /lib/modules/`:

ls -l /lib/modules/
total 8
drwxr-xr-x 6 root root 4096 Jun 1 09:48 4.10.0-21-generic
drwxr-xr-x 6 root root 4096 Jun 8 18:56 4.10.0-22-generic
---
ApportVersion: 2.20.4-0ubuntu4.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: danny 3135 F.... pulseaudio
 /dev/snd/controlC0: danny 3135 F.... pulseaudio
CurrentDesktop: GNOME
DistroRelease: Ubuntu 17.04
HibernationDevice: RESUME=UUID=2fe7f424-905b-4a88-bd42-ee4ba4137691
InstallationDate: Installed on 2016-02-04 (493 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
MachineType: Razer Blade
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.10.0-22-generic.efi.signed root=UUID=59c2c964-18a6-44cf-91c9-ddff0be3cd3b ro noprompt
ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
RelatedPackageVersions:
 linux-restricted-modules-4.10.0-22-generic N/A
 linux-backports-modules-4.10.0-22-generic N/A
 linux-firmware 1.164.1
Tags: zesty
Uname: Linux 4.10.0-22-generic x86_64
UpgradeStatus: Upgraded to zesty on 2017-04-17 (55 days ago)
UserGroups: adm cdrom dialout dip docker lpadmin plugdev sambashare sudo
_MarkForUpload: True
dmi.bios.date: 12/22/2014
dmi.bios.vendor: RAZER
dmi.bios.version: 3.15
dmi.board.asset.tag: NULL
dmi.board.name: RAZER
dmi.board.vendor: RAZER
dmi.board.version: 1.00
dmi.chassis.asset.tag: ABCDEF
dmi.chassis.type: 10
dmi.chassis.vendor: RAZER
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnRAZER:bvr3.15:bd12/22/2014:svnRazer:pnBlade:pvr3.04:rvnRAZER:rnRAZER:rvr1.00:cvnRAZER:ct10:cvrN/A:
dmi.product.name: Blade
dmi.product.version: 3.04
dmi.sys.vendor: Razer

Dan (dannyhajj)
description: updated
summary: - Kernel package complains that package does not exist during uninstall
+ Kernel package complains that headers do not exist during uninstall
Revision history for this message
Joseph Salisbury (jsalisbury) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1697376

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: zesty
Revision history for this message
Dan (dannyhajj) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Dan (dannyhajj) wrote : CRDA.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : IwConfig.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : JournalErrors.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : Lspci.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : Lsusb.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : ProcEnviron.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : ProcModules.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : PulseList.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : RfKill.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : UdevDb.txt

apport information

Revision history for this message
Dan (dannyhajj) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Medium
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.