Comment 2 for bug 1787460

Brian Murray (brian-murray) wrote :

Looking at .var.apt.history.log.txt we can see that in a previous package operation linux-generic was removed.

Start-Date: 2018-08-14 13:37:10
Commandline: apt dist-upgrade
Install: linux-headers-4.15.0-32-generic:amd64 (4.15.0-32.35, automatic), linux-headers-4.15.0-32:amd64 (4.15.0-32.35, automatic)
Upgrade: linux-headers-generic:amd64 (4.15.0.31.33, 4.15.0.32.34), linux-libc-dev:amd64 (4.15.0-31.33, 4.15.0-32.35)
Remove: linux-signed-generic:amd64 (4.15.0.31.33), linux-generic:amd64 (4.15.0.31.33)
End-Date: 2018-08-14 13:37:16

Subsequently during the unattended-upgrades run linux-image-generic is identified as an unused package. I'm only able to recreate this if I first remove the linux-generic package e.g.:

bdmurray@clean-bionic-amd64:~$ sudo apt remove linux-generic
[sudo] password for bdmurray:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-generic linux-image-generic thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 15.4 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 165999 files and directories currently installed.)
Removing linux-generic (4.15.0.30.32) ...
bdmurray@clean-bionic-amd64:~$ sudo unattended-upgrades -v
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
Removing unused kernel packages: linux-headers-generic linux-image-generic
(Reading database ... 165996 files and directories currently installed.)
Removing linux-headers-generic (4.15.0.30.32) ...
(Reading database ... 165993 files and directories currently installed.)
Removing linux-image-generic (4.15.0.30.32) ...
Packages that were successfully auto-removed: linux-headers-generic linux-image-generic
Packages that are kept back:
No packages found that can be upgraded unattended and no pending auto-removals