On Tue, Mar 27, 2018 at 11:46 PM, Steve Langasek
<steve.langa...@canonical.com> 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.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to unattended-upgrades in
Ubuntu.
https://bugs.launchpad.net/bugs/1675079

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

Status in unattended-upgrades package in Ubuntu:
  Fix Released
Status in update-manager package in Ubuntu:
  Fix Released
Status in unattended-upgrades source package in Xenial:
  New
Status in update-manager source package in Xenial:
  New
Status in unattended-upgrades source package in Artful:
  New
Status in update-manager source package in Artful:
  Incomplete

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 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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1675079/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to