Uninstalling unused kernel requires a reboot

Bug #1401425 reported by Lastique
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

When Linux kernel is updated, a package with the new kernel version is installed, and the system offers to reboot the machine (an icon appears in the system tray). After reboot the new kernel is loaded, but the old one is still installed. When I remove the old kernel packages (e.g. linux-image-3.16.0-25-generic, linux-image-extra-3.16.0-25-generic, linux-headers-3.16.0-25, linux-headers-3.16.0-25-generic) the system offers to reboot again, even though that kernel is not used. In essence this means that kernel upgrade requires two reboots.

Removing unused kernel packages should not require a reboot, and some time ago it actually worked that way. I can't remember exactly which kernel release broke that (probably, 3.16.0-24 or so).

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: linux-image-3.16.0-25-generic (not installed)
ProcVersionSignature: Ubuntu 3.16.0-26.35-generic 3.16.7-ckt1
Uname: Linux 3.16.0-26-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC3: lastique 2670 F.... pulseaudio
 /dev/snd/controlC2: lastique 2670 F.... pulseaudio
 /dev/snd/controlC0: lastique 2670 F.... pulseaudio
 /dev/snd/controlC1: lastique 2670 F.... pulseaudio
CurrentDesktop: KDE
Date: Thu Dec 11 10:58:29 2014
HibernationDevice: RESUME=UUID=91d1b3ae-bbf2-489a-93b8-87323a08a6e8
InstallationDate: Installed on 2013-11-01 (404 days ago)
InstallationMedia: Kubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MachineType: Apple Inc. MacBookPro8,2
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.16.0-26-generic root=UUID=d61403bb-991b-45fe-8052-ffc7a7e0db80 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-3.16.0-26-generic N/A
 linux-backports-modules-3.16.0-26-generic N/A
 linux-firmware 1.138
SourcePackage: linux
UpgradeStatus: Upgraded to utopic on 2014-11-01 (39 days ago)
dmi.bios.date: 01/24/12
dmi.bios.vendor: Apple Inc.
dmi.bios.version: MBP81.88Z.0047.B27.1201241646
dmi.board.asset.tag: Base Board Asset Tag#
dmi.board.name: Mac-94245A3940C91C80
dmi.board.vendor: Apple Inc.
dmi.board.version: MacBookPro8,2
dmi.chassis.type: 10
dmi.chassis.vendor: Apple Inc.
dmi.chassis.version: Mac-94245A3940C91C80
dmi.modalias: dmi:bvnAppleInc.:bvrMBP81.88Z.0047.B27.1201241646:bd01/24/12:svnAppleInc.:pnMacBookPro8,2:pvr1.0:rvnAppleInc.:rnMac-94245A3940C91C80:rvrMacBookPro8,2:cvnAppleInc.:ct10:cvrMac-94245A3940C91C80:
dmi.product.name: MacBookPro8,2
dmi.product.version: 1.0
dmi.sys.vendor: Apple Inc.

Revision history for this message
Lastique (andysem) wrote :
description: updated
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
affects: linux (Ubuntu) → software-center (Ubuntu)
Changed in software-center (Ubuntu):
status: Confirmed → New
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

A report of something that broke in a particular kernel release, which doesn't mention Ubuntu Software Center, is highly unlikely to be a problem in USC.

3.16.0.24 and 3.16.0.25 aren't listed at <https://launchpad.net/ubuntu/+source/linux>. But looking at <https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa/+build/6639809/+files/linux-image-3.16.0-28-generic_3.16.0-28.38_amd64.deb> for example, DEBIAN/postinst contains the magic words "/usr/share/update-notifier/notify-reboot-required", but DEBIAN/prerm and DEBIAN/postrm do not. So I don't see how uninstalling the package could prompt for a restart. Could you copy and paste the terminal output from when you do the removal?

affects: software-center (Ubuntu) → linux (Ubuntu)
Revision history for this message
Brad Figg (brad-figg) wrote :

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Lastique (andysem) wrote :

I'm on Kubuntu, I don't use Software Center. I install/remove packages with Muon package manager or apt-get from console. The offer to reboot appears regardless of the package manager I use.

I attached the console log from a kernel removal. The reboot offer appeared at some point during DKMS uninstall stage.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Lastique (andysem) wrote :

Addition: I suspect this may be related to Nvidia driver packages and DKMS. When I removed the packages, the offer to reboot appeared again. I can understand why that happened - even though I don't have a Nvidia card on this machine, the module is built for all kernels, including the active one, and removing it requires reconfiguring the active kernel. However, this should not happen when unused kernel is removed.

I attached apt logs of the Nvidia packages removal.

Revision history for this message
Anders Larsen (al-alarsen) wrote :

FWIW this happens on Trusty as well.

AFAICT the culprit is linux-image-extra-<version>-generic;
at least on Trusty postrm and postinst are identical; both iterate blindly through /etc/kernel/postinst.d thereby calling 'update-notifier', which is a symlink to /usr/share/update-notifier/notify-reboot-required

Revision history for this message
Anders Larsen (al-alarsen) wrote :

To clarify:

Removing any old version of linux-image-extra-<version>-generic will call /usr/share/update-notifier/notify-reboot-required

AFAICT the problem is not related to DKMS, Nvidia or any particular package manager.
It does not exist on headless virtual machines that uses linux-image-virtual instead of linux-image-generic.

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.