Unattended upgrades removed linux-image-generic
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Trusty |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
High
|
Unassigned | ||
Bionic |
Fix Released
|
Critical
|
Unassigned | ||
Cosmic |
Fix Released
|
Critical
|
Unassigned | ||
Disco |
Fix Released
|
Critical
|
Unassigned |
Bug Description
[Impact]
If a user accidentally removed linux-generic, unattended-upgrades will also autoremove linux-image-
[Test Case]
1. Remove all reverse dependencies of linux-image-generic
2. Mark linux-image-generic as automatically installed
3. Run unattended-upgrades -v --dry-run --debug to ensure that linux-image-generic is not removed (after verifying that it is, with old apt)
[Regression potential]
This adds two regular expressions to the list of packages that must not be automatically removed. As such, the only possible regression is that some packages starting with linux-image, not containing any dots, are not removed
[Original bug report]
On a fairly fresh install of 18.04 with no modifications whatsoever to the unattended-upgrades configuration, it decided to remove linux-image-generic which also removed linux-modules-extra which caused sound drivers to disappear, etc.
The relative snippet from /var/log/
2018-08-15 06:18:00,048 INFO Starting unattended upgrades script
2018-08-15 06:18:00,048 INFO Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,
2018-08-15 06:18:01,552 INFO Removing unused kernel packages: linux-headers-
2018-08-15 06:18:01,588 WARNING Keeping auto-removable linux-headers-
2018-08-15 06:18:09,476 INFO Packages that were successfully auto-removed: linux-headers-
2018-08-15 06:18:09,477 INFO Packages that are kept back: linux-headers-
2018-08-15 06:18:10,300 INFO Packages that will be upgraded: libxml2 linux-image-generic
2018-08-15 06:18:10,300 INFO Writing dpkg log to /var/log/
2018-08-15 06:18:39,238 INFO All upgrades installed
2018-08-15 06:18:42,818 INFO Packages that were successfully auto-removed: linux-image-generic linux-modules-
2018-08-15 06:18:42,818 INFO Packages that are kept back:
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: unattended-upgrades 1.1ubuntu1.18.04.5
ProcVersionSign
Uname: Linux 4.15.0-32-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.3
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Aug 16 13:17:30 2018
InstallationDate: Installed on 2018-07-24 (23 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180724)
PackageArchitec
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: unattended-upgrades
UpgradeStatus: No upgrade log present (probably fresh install)
CVE References
Changed in unattended-upgrades (Ubuntu): | |
importance: | High → Critical |
tags: | added: id-5b75e82507956e57463be7d9 |
affects: | linux-hwe (Ubuntu) → linux-meta-hwe (Ubuntu) |
description: | updated |
Changed in apt (Ubuntu Cosmic): | |
status: | New → Triaged |
Changed in apt (Ubuntu Bionic): | |
status: | New → Triaged |
Changed in apt (Ubuntu Xenial): | |
status: | New → Triaged |
Changed in apt (Ubuntu Xenial): | |
status: | Triaged → In Progress |
Changed in apt (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in apt (Ubuntu Cosmic): | |
importance: | Undecided → Critical |
Changed in apt (Ubuntu Bionic): | |
importance: | Undecided → Critical |
Changed in apt (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in apt (Ubuntu Trusty): | |
importance: | Undecided → High |
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 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) 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) generic: amd64 (4.15.0.31.33), linux-generic:amd64 (4.15.0.31.33)
Commandline: apt dist-upgrade
Install: linux-headers-
Upgrade: linux-headers-
Remove: linux-signed-
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 generic linux-image-generic thermald clean-bionic- amd64:~ $ sudo unattended-upgrades -v a=bionic- security, o=UbuntuESM, a=bionic generic linux-image-generic generic (4.15.0.30.32) ... generic linux-image-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-
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@
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=bionic, o=Ubuntu,
Removing unused kernel packages: linux-headers-
(Reading database ... 165996 files and directories currently installed.)
Removing linux-headers-
(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-
Packages that are kept back:
No packages found that can be upgraded unattended and no pending auto-removals