[Bug 1698159] Re: linux-cloud-tools version specific packages are being removed by unattended-upgrade's Remove-Unused-Dependencies
Balint Reczey
balint.reczey at canonical.com
Wed Mar 13 18:20:02 UTC 2019
Tested with 1.1ubuntu1.18.04.7~16.04.2:
ubuntu at ubuntu-Standard-PC-i440FX-PIIX-1996:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
feh libid3tag0 libimlib2 libjpeg-progs libjpeg9 linux-cloud-tools-4.15.0-39-generic linux-cloud-tools-common
linux-hwe-cloud-tools-4.15.0-39
0 upgraded, 0 newly installed, 8 to remove and 192 not upgraded.
After this operation, 2.452 kB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.
ubuntu at ubuntu-Standard-PC-i440FX-PIIX-1996:~$ sudo unattended-upgrade --dry-run --verbose --debug
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=xenial, o=Ubuntu,a=xenial-security
Using (^linux-image-[0-9]+\.[0-9\.]+-.*|^linux-headers-[0-9]+\.[0-9\.]+-.*|^linux-image-extra-[0-9]+\.[0-9\.]+-.*|^linux-modules-[0-9]+\.[0-9\.]+-.*|^linux-modules-extra-[0-9]+\.[0-9\.]+-.*|^linux-signed-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-image-[0-9]+\.[0-9\.]+-.*|^kfreebsd-headers-[0-9]+\.[0-9\.]+-.*|^gnumach-image-[0-9]+\.[0-9\.]+-.*|^.*-modules-[0-9]+\.[0-9\.]+-.*|^.*-kernel-[0-9]+\.[0-9\.]+-.*|^linux-backports-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-modules-.*-[0-9]+\.[0-9\.]+-.*|^linux-tools-[0-9]+\.[0-9\.]+-.*|^linux-cloud-tools-[0-9]+\.[0-9\.]+-.*) regexp to find kernel packages
Using (^linux-image-4\.15\.0\-39\-generic$|^linux-headers-4\.15\.0\-39\-generic$|^linux-image-extra-4\.15\.0\-39\-generic$|^linux-modules-4\.15\.0\-39\-generic$|^linux-modules-extra-4\.15\.0\-39\-generic$|^linux-signed-image-4\.15\.0\-39\-generic$|^kfreebsd-image-4\.15\.0\-39\-generic$|^kfreebsd-headers-4\.15\.0\-39\-generic$|^gnumach-image-4\.15\.0\-39\-generic$|^.*-modules-4\.15\.0\-39\-generic$|^.*-kernel-4\.15\.0\-39\-generic$|^linux-backports-modules-.*-4\.15\.0\-39\-generic$|^linux-modules-.*-4\.15\.0\-39\-generic$|^linux-tools-4\.15\.0\-39\-generic$|^linux-cloud-tools-4\.15\.0\-39\-generic$) regexp to find running kernel packages
Checking: avahi-autoipd ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'be.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'xenial-security' origin:'Ubuntu' label:'Ubuntu' site:'security.ubuntu.com' isTrusted:True>])
Checking: avahi-daemon ([<Origin component:'main' archive:'xenial-updates' origin:'Ubuntu' label:'Ubuntu' site:'be.archive.ubuntu.com' isTrusted:True>, <Origin component:'main' archive:'xenial-security' origin:'Ubuntu' label:'Ubuntu' site:'security.ubuntu.com' isTrusted:True>])
...
All upgrades installed
marking linux-cloud-tools-common for removal
Keeping the following auto-removable package(s) because they include linux-cloud-tools-4.15.0-39-generic which package is related to the running kernel: linux-cloud-tools-4.15.0-39-generic linux-cloud-tools-common linux-hwe-cloud-tools-4.15.0-39
marking libjpeg-progs for removal
marking feh for removal
marking libjpeg9 for removal
marking libimlib2 for removal
marking linux-cloud-tools-4.15.0-39-generic for removal
Keeping the following auto-removable package(s) because they include linux-cloud-tools-4.15.0-39-generic which package is related to the running kernel: linux-cloud-tools-4.15.0-39-generic
marking linux-hwe-cloud-tools-4.15.0-39 for removal
Keeping the following auto-removable package(s) because they include linux-cloud-tools-4.15.0-39-generic which package is related to the running kernel: linux-cloud-tools-4.15.0-39-generic linux-hwe-cloud-tools-4.15.0-39
marking libid3tag0 for removal
Packages that were successfully auto-removed:
Packages that are kept back: linux-cloud-tools-4.15.0-39-generic linux-cloud-tools-common linux-hwe-cloud-tools-4.15.0-39
InstCount=0 DelCount=0 BrokenCount=0
** Tags removed: verification-needed verification-needed-xenial
** Tags added: verification-done verification-done-xenial
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to unattended-upgrades in Ubuntu.
https://bugs.launchpad.net/bugs/1698159
Title:
linux-cloud-tools version specific packages are being removed by
unattended-upgrade's Remove-Unused-Dependencies
Status in apt package in Ubuntu:
Fix Released
Status in unattended-upgrades package in Ubuntu:
Fix Released
Status in apt source package in Trusty:
Triaged
Status in unattended-upgrades source package in Trusty:
New
Status in apt source package in Xenial:
Fix Released
Status in unattended-upgrades source package in Xenial:
Fix Committed
Status in apt source package in Bionic:
Fix Released
Status in unattended-upgrades source package in Bionic:
Fix Released
Bug description:
[Impact]
When running kernel version 4.4.0-78 (for example) and the unattended-upgrade packages installs a new kernel 4.4.0-79 (for example) the linux-cloud-tools-4.4.0-78 and linux-cloud-tools-4.4.0-78-generic packages are removed by the Remove-Unused-Dependencies rule, because unlike "normal" kernel packages they are not excluded by /etc/apt/apt.conf.d/01autoremove-kernels.
The linux-cloud-tools package has the hyper-v integration services
daemons in it, so it's deletion leaves some of the integration not
working.
Could /etc/apt/apt.conf.d/01autoremove-kernels be updated so other
hyper-v users aren't caught out by this?
Thanks,
Ian.
[Test case (apt)]
Make sure that linux-cloud-tools for protected kernels are listed in
APT::NeverAutoRemove, for example, on cosmic:
"^linux-cloud-tools-4\.17\.0-9-generic$";
"^linux-cloud-tools-4\.18\.0-7-generic$";
Those are in 01autoremove-kernels
[Test case (unattended-upgrades)]
* Check the running kernel and install relevant cloud-tools packages:
# uname -a
Linux x-uu-lp-1737637 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
root at x-uu-lp-1737637:~# apt-cache search 4.15.0-39-generic
linux-cloud-tools-4.15.0-39-generic - Linux kernel version specific cloud tools for version 4.15.0-39
linux-headers-4.15.0-39-generic - Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
linux-image-4.15.0-39-generic - Signed kernel image generic
linux-image-unsigned-4.15.0-39-generic - Linux kernel image for version 4.15.0 on 64 bit x86 SMP
linux-modules-4.15.0-39-generic - Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
linux-modules-extra-4.15.0-39-generic - Linux kernel extra modules for version 4.15.0 on 64 bit x86 SMP
# apt install linux-cloud-tools-4.15.0-39-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
linux-cloud-tools-common linux-hwe-cloud-tools-4.15.0-39
The following NEW packages will be installed:
linux-cloud-tools-4.15.0-39-generic linux-cloud-tools-common linux-hwe-cloud-tools-4.15.0-39
0 upgraded, 3 newly installed, 0 to remove and 17 not upgraded.
Need to get 119 kB of archives.
After this operation, 854 kB of additional disk space will be used.
Do you want to continue? [Y/n]
...
* Mark them autoremovable and configure u-u to autoremove unused
packages:
# apt-mark auto linux-cloud-tools-4.15.0-39-generic
linux-cloud-tools-4.15.0-39-generic set to automatically installed.
### set Unattended-Upgrade::Remove-Unused-Dependencies "true";
# vi /etc/apt/apt.conf.d/50unattended-upgrades
* The not fixed version of u-u removes the packages:
# unattended-upgrade --dry-run --verbose
...
All upgrades installed
Packages that are auto removed: 'libfreetype6 linux-cloud-tools-4.15.0-39-generic linux-cloud-tools-common linux-hwe-cloud-tools-4.15.0-39'
Packages were successfully auto-removed
#
* The fixed version does not:
# unattended-upgrade --dry-run --verbose
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=xenial, o=Ubuntu,a=xenial-security, o=UbuntuESM,a=xenial
Removing unused kernel packages: linux-cloud-tools-common
Keeping auto-removable linux-cloud-tools-common package(s) because it would also remove the following packages which should be kept in this step: linux-cloud-tools-4.15.0-39-generic linux-hwe-cloud-tools-4.15.0-39
...
[Regression Potential]
* some linux-cloud-tools will linger around, so it takes more space.
[Other info]
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: unattended-upgrades 0.90ubuntu0.6
ProcVersionSignature: Ubuntu 4.4.0-79.100-generic 4.4.67
Uname: Linux 4.4.0-79-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.6
Architecture: amd64
Date: Thu Jun 15 15:27:35 2017
InstallationDate: Installed on 2016-04-25 (415 days ago)
InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.3)
PackageArchitecture: all
SourcePackage: unattended-upgrades
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.apt.apt.conf.d.10periodic: [modified]
modified.conffile..etc.update-motd.d.90-updates-available: [deleted]
modified.conffile..etc.update-motd.d.98-fsck-at-reboot: [deleted]
modified.conffile..etc.update-motd.d.98-reboot-required: [deleted]
mtime.conffile..etc.apt.apt.conf.d.10periodic: 2016-04-25T16:28:36.640000
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1698159/+subscriptions
More information about the foundations-bugs
mailing list