[Kernel-packages] [Bug 1697376] Re: Kernel package complains that headers do not exist during uninstall

2017-06-12 Thread Joseph Salisbury
** Changed in: linux (Ubuntu)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1697376

Title:
  Kernel package complains that headers do not exist during uninstall

Status in linux package in Ubuntu:
  Confirmed

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 

[Kernel-packages] [Bug 1697376] Re: Kernel package complains that headers do not exist during uninstall

2017-06-12 Thread Dan
apport information

** Tags added: apport-collected

** Description changed:

  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