New packages (e.g. kernels) not marked for autoremove if update-manager set to "display" rather than "install automatically"

Bug #1492709 reported by Jacob Nevins
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On all my Trusty installations, if the settings for "when there are updates" in the update-manager GUI are set to "Display immediately" rather than "Download and install automatically", then any newly installed packages are not marked as automatically installed, preventing the removal of old kernels (by e.g. "apt-get autoremove").

I usually have "Display immediately" set, so I can see what security updates are going by. This leads to my systems silting up with old kernels; I manually uninstall them occasionally. I was expecting them to be automatically managed.

The relevant kernel packages do not show up in "apt-mark showauto"; I think this is the problem. I think the machinery for keeping selected kernels (visible in /etc/apt/apt.conf.d/01autoremove-kernels) is working fine and is not the source of the problem.

I confirmed my diagnosis by temporarily setting my netbook to "Download and install automatically" and waiting for a kernel security update. The newly installed kernel packages (3.13.0-63) showed up in "apt-mark showauto". I left my desktop machine at "Display immediately", and the same kernel does not appear in "apt-mark showauto", as usual.

I'm guessing the issue is that if the user is given the opportunity to manually choose whether packages are installed, then just leaving the checkboxes checked is treated as an explicit manual installation. Or something like that.

(This might be a duplicate of bug #1439769. However, I wasn't sure, as (a) that bug doesn't mention the UI configuration as being significant, (b) only mentions Vivid, so maybe it's a different/worse problem. Thanks to Colin Watson for explaining to me how the kernel autoremoval machinery works.)

update-manager version: 1:0.196.13 on Ubuntu 14.04.3 LTS
(as far as I recall, this has been the behaviour ever since I upgraded to Trusty)

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

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Jarno Suni (jarnos) wrote :

Does it help similarly, if you set automatic security updates by "sudo dpkg-reconfigure unattended-upgrades", instead of using the GUI way (Software & Updates)?

Revision history for this message
Jarno Suni (jarnos) wrote :

You could remove old kernels automatically by running a specific script for that purpose e.g. during startup (as root).

Revision history for this message
Jarno Suni (jarnos) wrote :

IIRC this is fixed in Ubuntu 15.10.

Revision history for this message
Tero Marttila (terom-u) wrote :

Crude, crude workaround on trusty:

    aptitude markauto '?name(linux-image-.*-generic)'

This lets 'apt-get autoremove' clean out old kernels installed via update-manager, while /etc/apt/apt.conf.d/01autoremove-kernels ensures that some kernels are retained.

Jarno Suni (jarnos)
tags: added: trusty
Revision history for this message
Jarno Suni (jarnos) wrote :

What backend update-manager uses for installing new packages?

Balint Reczey (rbalint)
summary: - New packages (e.g. kernels) not marked for autoremove iff update-manager
+ New packages (e.g. kernels) not marked for autoremove if update-manager
set to "display" rather than "install automatically"
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.