16.04 LTS Partition /boot fills up with Kernel images, gets underwear in a twist

Bug #1675079 reported by Bryce Nesbitt
306
This bug affects 238 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Artful
Won't Fix
Undecided
Unassigned
update-manager (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Artful
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Update-manager and unattended-upgrades install many kernel packages during the lifetime of a release but does not remove them automatically leading to those packages filling disk space potentially completely filling /boot and making the system unable to install updates or even boot.
 * Stable release users are impacted by this bug for years and their systems already collected many autoremovable unused kernel packages, thus they would benefit from backporting the fix greatly.
 * The bug is fixed by removing autoremovable (not currently booted) kernel packages when running unattended-upgrades or update-manager. Update manager offers the kernel removals when there are other updates to be installed.

[Test Case]

 1. Install kernel packages to be removed, mark them auto-installed and run apt's kernel hook script to make apt consider them autoremovable:

  sudo apt install -y linux-image-extra-4.4.0-92-generic linux-image-extra-4.4.0-93-generic
  sudo apt-mark auto linux-image-extra-4.4.0-92-generic linux-image-extra-4.4.0-93-generic
  sudo /etc/kernel/postinst.d/apt-auto-removal

 2. Also downgrade a package to be upgraded:

   sudo apt-get install -y --allow-downgrades ca-certificates=20160104ubuntu1

 3. (update-manager). Run update-manager and observe that kernel packages are offered for removal in Details of updates.

  sudo update-manager

 4. (update-manager) Click on Install Now and observe that the kernel packages are removed.

 3. (unattended-upgrades) Run unattended-upgrades manually and observe the removal of the autoremovable kernel packages:

  sudo unattended-upgrade -v

[Regression Potential]

 The change may cause update-manager or unattanded-upgrades to remove used kernel packages or fail to install other package updates.

[Other Info]

The unattended-upgrades fix is uploaded with many other fixes and those may cause regressions in other areas in unattended-upgrades.

[Original bug text]

On a 16.04LTS system, the /boot partition will eventually fill with Kernel images, until the point where "apt-get autoremove" can't complete.

This issue has previously been reported as fixed, but it is not fixed:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1357093

Generally what I see is the final kernel image that fills the drive is incompletely installed (the header package does not make it). "apt-get autoremove" tries to work, but fails. I must manually remove kernel images to free enough space.

I see this on a machine used by my elderly parents, where 'Download and install updates automatically' is set. And on my home machines, where the setting is elsewhere.

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

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

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

Is this more than just a duplicate of Bug #1624644?

Revision history for this message
Bryce Nesbitt (bryce2) wrote :

Bug #1624644 is a very old one, marked as fixed, with considerable discussion and confusion.

This bug is a clear indication that as of 16.04LTS, a bug exists with /boot filling up. Maybe it's the same cause, maybe it's different cause. This bug is trivial to reproduce: it happens on freshly installed stock no-changes versions of 16.04 if LVM is chosen, and the machine is left idle for 3 or more update cycles.

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

It is not that old and not marked as fixed.

Do you claim that the bug happens even if no kernel updates are being installed by Software Updater or by e.g. apt, but only by unattended-upgrades?

tags: added: xenial
Jarno Suni (jarnos)
tags: added: pecise trusty
tags: removed: pecise trusty
tags: added: full-boot
Revision history for this message
Jarno Suni (jarnos) wrote :

Could you attach logs in
/var/log/unattended-upgrades/
from such a system?

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

Also please show the output of:
dpkg-query -Wf'${db:Status-Abbrev} ${Package}\n' | grep -E ' linux-(.*-)?image-[0-9]'

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

This bug was fixed in the package unattended-upgrades - 1.0ubuntu1

---------------
unattended-upgrades (1.0ubuntu1) bionic; urgency=medium

  * Merge from Debian unstable
    - Remaining changes:
      - unattended-upgrades: Do not automatically upgrade the development
        release of Ubuntu unless Unattended-Upgrade::DevRelease is true.
    - Dropped changes, included in Debian:
      - Run upgrade-between-snapshots only on amd64.
        The test exercises only unattented-upgrade's Python code and uses
        dependencies from the frozen Debian snapshot archive thus running
        it on all architectures would provide little benefit.

unattended-upgrades (1.0) unstable; urgency=medium

  [ Simon Arlott ]
  * Revert sending mails on WARNINGS when in MailOnlyOnError mode"
  * Consider conffile prompts to be errors (Closes: #852465)
    Flag packages that have to be upgraded manually because of a conffile
    prompt and consider this to be an error when sending email or exiting.

  [ Simon McVittie ]
  * Add python, python3, setuptools, DistutilsExtra to Build-Depends.
    They are needed for `clean`, so Build-Depends-Indep is not enough.
  * Add .gitignore and debian/.gitignore
  * Remove bzr configuration.
    This is unnecessary now that u-u is in git.

  [ Michael Vogt ]
  * unattended-upgrades: tweak mail-on-warnings PR
  * unattended-upgrade: extract is_autoremove_valid helper

  [ Balint Reczey ]
  * Run upgrade-between-snapshots only on amd64.
    The test exercises only unattented-upgrade's Python code and uses
    dependencies from the frozen Debian snapshot archive thus running
    it on all architectures would provide little benefit.
  * Clean up processes started for getting md5 sums
  * Don't keep /var/lib/dpkg/status open multiple times
  * Adjust candidates in UnattendedUpgradesCache.open()
  * Perform autoremovals in minimal steps, too.
    Also add check to remove only the set of packages selected for autoremoval.
    Without that check unattended-upgrades when (by default) configured to
    remove newly unused packages could also remove auto removable packages
    which were unused before starting starting the upgrade step.
  * Remove unused automatically installed kernel packages
    (LP: #1357093, #1624644, #1675079, #1698159)
  * Stop including Python syntax in the report (Closes: #876796)
  * Do not auto remove packages related to the running kernel (LP: #1615381)
  * Check packages to be autoremoved against blacklists, whitelists.
    Also check if the packages are held.
  * Report package removals in the summary email (Closes: #876797)
  * Run upgrade-between-snapshots test with debugging enabled
  * Don't create new UnattendedUpgradesCache for checking for autoremovals
    .open() refreshes the state in each cache_commit(), this is enough
  * Update .pot and .po files
  * Update .travis.yml to actually build and test u-u from the repo
  * Run only a simple installation test on Travis, the system upgrade
    test was always failing

 -- Balint Reczey <email address hidden> Thu, 01 Mar 2018 17:29:33 +0700

Changed in unattended-upgrades (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

This bug is linked in update-manager SRUs but does not target update-manager (and is missing SRU information in the description). The bug as written right now does not seem to directly affect update-manger - is that the case?

Revision history for this message
Balint Reczey (rbalint) wrote :

The same happens with update-manager.

description: updated
Changed in update-manager (Ubuntu):
status: New → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

Why does the update-manager upload include this code?:

+ running_kernel_version = subprocess.check_output(
+ ["uname", "-r"], universal_newlines=True).rstrip()
+ self.running_kernel_pkgs_regexp = re.compile("(" + "|".join(
+ [("^" + p + ".*" + running_kernel_version)
+ if not p.startswith(".*") else (running_kernel_version + p)
+ for p in apt_versioned_kernel_pkgs]) + ")")
[...]
+ if (pkg.is_auto_removable and
+ (cache.versioned_kernel_pkgs_regexp and
+ cache.versioned_kernel_pkgs_regexp.match(pkg.name) and
+ not cache.running_kernel_pkgs_regexp.match(pkg.name))):
+ kernel_autoremove_pkgs.append(pkg)
+ pkg.mark_delete()

apt already has an implementation in /etc/kernel/postinst.d/apt-auto-removal which ensures that the currently-running kernel is not autoremoved. Why are you duplicating this functionality in update-manager?

Changed in update-manager (Ubuntu Artful):
status: New → Incomplete
Revision history for this message
Balint Reczey (rbalint) wrote : Re: [Bug 1675079] Re: 16.04 LTS Partition /boot fills up with Kernel images, gets underwear in a twist

On Tue, Mar 27, 2018 at 11:46 PM, Steve Langasek
<email address hidden> wrote:
> Why does the update-manager upload include this code?:
>
> + running_kernel_version = subprocess.check_output(
> + ["uname", "-r"], universal_newlines=True).rstrip()
> + self.running_kernel_pkgs_regexp = re.compile("(" + "|".join(
> + [("^" + p + ".*" + running_kernel_version)
> + if not p.startswith(".*") else (running_kernel_version + p)
> + for p in apt_versioned_kernel_pkgs]) + ")")
> [...]
> + if (pkg.is_auto_removable and
> + (cache.versioned_kernel_pkgs_regexp and
> + cache.versioned_kernel_pkgs_regexp.match(pkg.name) and
> + not cache.running_kernel_pkgs_regexp.match(pkg.name))):
> + kernel_autoremove_pkgs.append(pkg)
> + pkg.mark_delete()
>
> apt already has an implementation in /etc/kernel/postinst.d/apt-auto-
> removal which ensures that the currently-running kernel is not
> autoremoved. Why are you duplicating this functionality in update-
> manager?

The code in apt ensures that the kernel running at the time the last
kernel was installed is not offered for autoremoval but it does not
protect the _currently_ running kernel. The issue is tracked in LP:
#1615381 and unattended-upgrades already uses the same method to
protect the _current_ running kernel.
The proper fix for LP: #1615381 would be too intrusive in apt for
inclusion in Bionic at this stage of the cycle.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Bryce, or anyone else affected,

Accepted update-manager into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-manager/1:17.10.14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in update-manager (Ubuntu Artful):
status: Incomplete → Fix Committed
tags: added: verification-needed verification-needed-artful
Changed in update-manager (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Bryce, or anyone else affected,

Accepted update-manager into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-manager/1:16.04.13 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

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

Does this need different kind of verification for Xenial than what I did in Bug #1624644?

description: updated
tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Jarno Suni (jarnos) wrote :

Oh, the test case seems to be same, marking verified.

Revision history for this message
Brian Murray (brian-murray) wrote :

Setting to v-done for artful since I did the verification for bug 1624644.

tags: added: verification-done-artful
removed: verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:16.04.13

---------------
update-manager (1:16.04.13) xenial; urgency=medium

  * Offer removal of unused autoremovable kernel packages
    (LP: #1624644, #1675079)
  * Support package removals in install backends and really remove packages
    (LP: #1624644, #1675079)
  * Keep PEP 8 checks happy
  * Place .keep files in empty directories to keep them when converting the
    repo to git (LP: #1758963)

 -- Balint Reczey <email address hidden> Sun, 25 Mar 2018 20:10:49 +0100

Changed in update-manager (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for update-manager has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package update-manager - 1:17.10.14

---------------
update-manager (1:17.10.14) artful; urgency=medium

  * Offer removal of unused autoremovable kernel packages
    (LP: #1624644, #1675079)
  * Support package removals in install backends and really remove packages
    (LP: #1624644, #1675079)
  * Keep PEP 8 checks happy
  * Place .keep files in empty directories to keep them when converting the
    repo to git (LP: #1758963)

 -- Balint Reczey <email address hidden> Sun, 25 Mar 2018 19:57:57 +0100

Changed in update-manager (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Robert Merrill (rfmerrill) wrote :

Sorry to necro this bug but can someone clarify that as of now, a fresh 16.04 install with the defaults+LVM will *not* fill the /boot partition? It was still happening for me as recently as a month or two ago I think.

Revision history for this message
Balint Reczey (rbalint) wrote :

Fixed update-manager is stuck in phasing because it triggered old bugs like LP: #1791931 with the removals.

If you run sudo apt-get install update-manager to bypass phasing it will remove the old kernels which are not marked manually installed.

Balint Reczey (rbalint)
Changed in unattended-upgrades (Ubuntu Artful):
status: New → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in unattended-upgrades (Ubuntu Xenial):
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Bryce, or anyone else affected,

Accepted unattended-upgrades into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.1ubuntu1.18.04.7~16.04.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in unattended-upgrades (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed-xenial
removed: verification-done-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Bryce, or anyone else affected,

Accepted unattended-upgrades into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.1ubuntu1.18.04.7~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Not Martin Wimpress (not-martinwimpress) wrote :

Balint, I'm confused on your statement in the other dup bug report (https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1357093/comments/129 ) that this is fixed in 18.04, but looking at line 60 in the "50unattended-upgrades.Ubuntu" file in the current package (1.1ubuntu1.18.04.7):

//Unattended-Upgrade::Remove-Unused-Kernel-Packages "false";

...it appears to me that 2 modifications are needed before any kernels are auto-removed. I saw your Nov 9th commit to switch it to "true", but doesn't the line still needs to be commented out in order to activate?

Revision history for this message
Steve Langasek (vorlon) wrote :

The line is commented out, that's what the leading // characters mean. Therefore the default is used, and the default is true.

Revision history for this message
Not Martin Wimpress (not-martinwimpress) wrote :

I understand. Saying "the default is true" is a bit puzzling, but after reading https://github.com/mvo5/unattended-upgrades/blob/master/unattended-upgrade#L1957 , the conditional makes sense since the default [object] is defined as "True". It also makes sense how this works for proposed-16.04 since that line isn't even mentioned in the config but "True" is pushed in the script anyway.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Bryce, or anyone else affected,

Accepted unattended-upgrades into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/1.1ubuntu1.18.04.7~16.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Balint Reczey (rbalint) wrote :
Download full text (5.1 KiB)

Tested with 1.1ubuntu1.18.04.7~16.04.2 on Xenial:

root@x-uu-lp-1260041:~# apt-mark auto linux-image-extra-4.8.0-56-generic linux-image-extra-4.8.0-58-generic linux-image-extra-4.8.0-54-generic linux-image-extra-4.8.0-53-generic
linux-image-extra-4.8.0-56-generic set to automatically installed.
linux-image-extra-4.8.0-58-generic set to automatically installed.
linux-image-extra-4.8.0-54-generic set to automatically installed.
linux-image-extra-4.8.0-53-generic set to automatically installed.
root@x-uu-lp-1260041:~# unattended-upgrade --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, o=Ubuntu,a=xenial-updates
Removing unused kernel packages: linux-image-extra-4.8.0-54-generic linux-image-4.8.0-54-generic
Keeping auto-removable linux-image-extra-4.8.0-54-generic package(s) because it would also remove the following packages which should be kept in this step: libpam-systemd libsystemd0 libudev1 systemd systemd-sysv udev
(Reading database ... 53554 files and directories currently installed.)
Removing linux-image-extra-4.8.0-54-generic (4.8.0-54.57~16.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-54-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
Removing linux-image-4.8.0-54-generic (4.8.0-54.57~16.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
update-initramfs: Deleting /boot/initrd.img-4.8.0-54-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.8.0-54-generic /boot/vmlinuz-4.8.0-54-generic
Packages that were successfully auto-removed: linux-image-4.8.0-54-generic linux-image-extra-4.8.0-54-generic
Packages that are kept back: linux-image-extra-4.8.0-54-generic
Packages that will be upgraded: libpam-systemd libsystemd0 libudev1 systemd systemd-sysv udev
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
(Reading database ... 47681 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_229-4ubuntu21.17_amd64.deb ...
Unpacking systemd-sysv (229-4ubuntu21.17) over (229-4ubuntu21.16) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd-sysv (229-4ubuntu21.17) ...
Log ended: 2019-03-13 17:17:36

Log started: 2019-03-13 17:17:36
(Reading database ... 47681 files and directories currently installed.)
Preparing to unpack .../udev_229-4ubuntu21.17_amd64.deb ...
Unpacking udev (229-4ubuntu21.17) over (229-4ubuntu21.16) ...
Preparing to unpack .../libudev1_229-4ubunt...

Read more...

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Jarno Suni (jarnos) wrote :

@rbalint Why it does not remove linux-image-4.8.0-53-generic?

Revision history for this message
Balint Reczey (rbalint) wrote :

@jarnos Most likely i forgot running /etc/kernel/postinst.d/apt-auto-removal and -53- was still protected.
I don't have this system anymore, and I think the verification is convincing enough to not repeat it for this bug.

Revision history for this message
Balint Reczey (rbalint) wrote :

@jarnos But thank you for your attention to details.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (33.9 KiB)

This bug was fixed in the package unattended-upgrades - 1.1ubuntu1.18.04.7~16.04.2

---------------
unattended-upgrades (1.1ubuntu1.18.04.7~16.04.2) xenial; urgency=medium

  * Don't check blacklist too early and report updates from not allowed origins
    as kept back. (LP: #1781176)
  * test/test_blacklisted_wrong_origin.py: Fix and enable test
  * Filter out progress indicator from dpkg log (LP: #1599646)
  * Clear cache when autoremoval fails (LP: #1779157)
  * Find autoremovable kernel packages using the patterns in APT's way
    (LP: #1815494)

unattended-upgrades (1.1ubuntu1.18.04.7~16.04.1) xenial; urgency=medium

  * Start service after systemd-logind.service to be able to take inhibition
    lock (LP: #1806487)
  * Handle gracefully when logind is down (LP: #1806487)

unattended-upgrades (1.1ubuntu1.18.04.7~16.04.0) xenial; urgency=medium

  * Backport to Xenial (LP: #1702793)
  * Revert to build-depending on debhelper (>= 9~) and dh-systemd
  * Revert configuration example changes to avoid triggering a debconf question
  * debian/postinst: Update recovery to be triggered on Xenial's package versions

unattended-upgrades (1.1ubuntu1.18.04.7) bionic; urgency=medium

  * Trigger unattended-upgrade-shutdown actions with PrepareForShutdown()
    Performing upgrades in service's ExecStop did not work when the upgrades
    involved restarting services because systemd blocked other stop/start
    actions making maintainer scripts time out and be killed leaving a broken
    system behind.
    Running unattended-upgrades.service before shutdown.target as a oneshot
    service made it run after unmounting filesystems and scheduling services
    properly on shutdown is a complex problem and adding more services to the
    mix make it even more fragile.
    The solution of monitoring PrepareForShutdown() signal from DBus
    allows Unattended Upgrade to run _before_ the jobs related to shutdown are
    queued thus package upgrades can safely restart services without
    risking causing deadlocks or breaking part of the shutdown actions.
    Also ask running unattended-upgrades to stop when shutdown starts even in
    InstallOnShutdown mode and refactor most of unattended-upgrade-shutdown to
    UnattendedUpgradesShutdown class. (LP: #1778219)
  * Increase logind's InhibitDelayMaxSec to 30s. (LP: #1778219)
    This allows more time for unattended-upgrades to shut down gracefully
    or even install a few packages in InstallOnShutdown mode, but is still a
    big step back from the 30 minutes allowed for InstallOnShutdown previously.
    Users enabling InstallOnShutdown node are advised to increase
    InhibitDelayMaxSec even further possibly to 30 minutes.
    - Add NEWS entry about increasing InhibitDelayMaxSec and InstallOnShutdown
      changes
  * Ignore "W503 line break before binary operator"
    because it will become the best practice and breaks the build
  * Stop using ActionGroups, they interfere with apt.Cache.clear()
    causing all autoremovable packages to be handled as newly autoremovable
    ones and be removed by default. Dropping ActionGroup usage does not slow
    down the most frequent case of not having anything to upgrade a...

Changed in unattended-upgrades (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
danhash (danhash) wrote :

Forgive me if this has been asked and answered, but I was pointed here by bug #1675079 which has affected my Ubuntu 16.04 LTS server for a very long time. I have tried time and again to understand how to fix the problem, and I can't figure it out. I see the bug is marked as fixed, and there are several comments with commands pasted, but I can't figure out which command(s) to run to clear the unused images off of /boot. Please help me.

Revision history for this message
oldfred (oldfred) wrote :

At this point better to start a thread on Ubuntu forums. https://ubuntuforums.org/forumdisplay.php?f=339
Already many similar questions and answers.

Also from live installer: Please copy & paste link to the Boot-info summary report ( do not post report), the auto fix sometimes can create more issues.
 https://help.ubuntu.com/community/Boot-Repair

Revision history for this message
Jarno Suni (jarnos) wrote :
Revision history for this message
private_lock (private-lock) wrote :

I'm hitting two distinct errors here:

1) Accepting the updates from the GUI-notification, all my kernels over the past months get marked as "manual" - though I have the strong feeling, they should be automatic and only kept until superseded by jet more updates:

root@Meerschweinchen:/boot# apt-mark showmanual 'linux-image-.*'
linux-image-5.4.0-52-generic
linux-image-5.4.0-54-generic
linux-image-5.4.0-56-generic

2) Trying to mark an old kernel as "auto" will still not *MANUALLY* "autoremove":
root@Meerschweinchen:/boot# sudo apt-mark auto linux-image-5.4.0-51-generic
linux-image-5.4.0-51-generic wurde bereits auf automatisch installiert gesetzt.
root@Meerschweinchen:/boot# apt-mark showauto 'linux-image-.*'
linux-image-5.4.0-51-generic
linux-image-generic
root@Meerschweinchen:/boot# apt-get autoclean
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
root@Meerschweinchen:/boot# apt-get autoremove
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

This system is:
root@Meerschweinchen:/boot# uname -a
Linux Meerschweinchen 5.4.0-56-generic #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@Meerschweinchen:/boot# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal

Revision history for this message
private_lock (private-lock) wrote :

Update to comment 37

Issue 2) was my fault of not properly unmarking all components of the kernel, so that some of it kept the "manual" status and prevented removal. But once I severed all those marks, "apt autoremove" could do it's work.

Issue 1) was reported first here:
https://bugs.kde.org/show_bug.cgi?id=430296
and then here:
https://github.com/hughsie/PackageKit/issues/450

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.