"Unattended-Upgrade::Remove-Unused-Dependencies" does not work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unattended-upgrades (Ubuntu) |
Fix Released
|
Medium
|
Michael Vogt | ||
Precise |
Fix Released
|
Medium
|
Brian Murray | ||
Trusty |
Fix Released
|
High
|
Unassigned |
Bug Description
I have a system that runs unattended-upgrades just fine. Now i want to automate removal of old kernels and kernel header packages that are accumulating otherwise. So i set 'Unattended-
----
Details: Lots of stuff pending autoremoval:
$ apt-get --assume-no autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
linux-
0 upgraded, 0 newly installed, 41 to remove and 13 not upgraded.
After this operation, 2,893 MB disk space will be freed.
Do you want to continue [Y/n]? N
Abort.
Note that the majority of these packages have been installed by unattended-upgrades from precise-security.
According to the comments within/
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-
but nothing happens (note the line "Packages that are auto removed: '' ":
$ unattended-upgrades --debug --dry-run
Initial blacklisted packages:
Starting unattended upgrades script
Allowed origins are: ['o=Ubuntu,
adjusting candidate version: '<Version: package:
adjusting candidate version: '<Version: package:
adjusting candidate version: '<Version: package:
adjusting candidate version: '<Version: package:
adjusting candidate version: '<Version: package:
adjusting candidate version: '<Version: package:'libdrm2' version:
Checking: bc (["<Origin component:'main' archive:
Checking: grub-common (["<Origin component:'main' archive:
Checking: grub-pc (["<Origin component:'main' archive:
Checking: grub-pc-bin (["<Origin component:'main' archive:
Checking: grub2-common (["<Origin component:'main' archive:
Checking: iproute (["<Origin component:'main' archive:
Checking: landscape-common (["<Origin component:'main' archive:
pkgs that look like they should be upgraded:
Fetched 0 B in 0s (0 B/s)
blacklist: []
Packages that are auto removed: ''
InstCount=0 DelCount=0 BrokenCout=0
No packages found that can be upgraded unattended
----
I am using unattended-
tags: | added: precise |
tags: | added: trusty |
Changed in unattended-upgrades (Ubuntu): | |
importance: | Undecided → Medium |
assignee: | nobody → Michael Vogt (mvo) |
status: | Confirmed → Triaged |
Changed in unattended-upgrades (Ubuntu Trusty): | |
status: | New → Triaged |
importance: | Undecided → High |
tags: |
added: verification-done removed: verification-needed |
Changed in unattended-upgrades (Ubuntu Precise): | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in unattended-upgrades (Ubuntu Precise): | |
status: | Triaged → In Progress |
assignee: | nobody → Brian Murray (brian-murray) |
tags: |
added: verification-done removed: verification-needed |
I had a quick glance at /usr/bin/ unattended- upgrade, and it looks like that Unattended- Upgrade: :Remove- Unused- Dependencies only autoremoves dependancies that have become auto-removeable during *this* very run of unattended-upgrade! Anything that had already been auto-removeable before invokation of /usr/bin/ unattended- upgrade will not get autoremoved by unattended-upgrade.
(See lists "pkgs_auto_ removable" set in line 706, "now_auto_ removable" set in line 817, and only their difference being autoremoved in line 819)
Is that correct?
If this is the intended functionality of Unattended- Upgrade: :Remove- Unused- Dependencies, then this is not a bug with unattended-upgrade, but with its documentation. /etc/apt/ apt.conf. d/50unattended- upgrades says
// Do automatic removal of new unused dependencies after the upgrade Upgrade: :Remove- Unused- Dependencies "true";
// (equivalent to apt-get autoremove)
Unattended-
But it's actually only equivalent to apt-get autoremove if there was nothing to be autoremoved beforehand. That should be clarified.