"a more helpful error" that the title of this bug report calls for would
not free you from the need to remove kernels manually.

I made a script called linux-purge to make it easy to remove extra
kernels even in tricky conditions:
https://www.bountysource.com/issues/38300038-feature-request-the-
command-should-work-like-this (It is designed to handle dependency
problems and even problem running out of inodes - that may occur when
installing a kernel - when using --fix option.)

As for preventing system from getting full of kernels automatically, 
unattended-upgrades provides an adequate solution for most cases. You can 
configure it in Ubuntu 16.04 like this:
Add line 

Unattended-Upgrade::Remove-Unused-Dependencies "true";

in /etc/apt/apt.conf.d/50unattended-upgrades

(since unattended-upgrades is enabled by default in 16.04; the
configuration acts as if running "apt-get autoremove" periodically.)

The default setting in 16.04 is

Unattended-Upgrade::Remove-New-Unused-Dependencies "true";

but that does not work in some cases (Bug #1624644); the former setting
overrides it.

Alternatively, putting "linux-purge --yes --keep 1" as a cron job or alike 
could do automatic kernel purging, (if no other process has locked dpkg at the 
time of calling it).
It has some differences to the unattended-upgrades way:
- It works in 12.04 and 14.04, too. (unattended-upgrades cannot remove manually 
installed kernels that will be around, if user installs kernel using e.g. 
update-manager; Bug #1439769.)
- The number of kernels to keep is configurable. It keeps the given number of 
nearest older kernels of each installed kernel update series, e.g. 
linux-generic and linux-generic-lts-xenial, not necessarily the installed 
kernels with greatest versions. (You could use --auto-only to keep
manually installed kernels, too, but you probably would not want to use it in 
12.04 and 14.04.)
- Current kernel will never be removed. (Bug #1615381)
- It removes configuration files, too. (i.e. it purges)
- It only removes versioned kernel packages whose name start by linux-.

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

Title:
  update-initramfs should produce a more helpful error when there isn't
  enough  free space

Status in initramfs-tools:
  Confirmed
Status in initramfs-tools package in Ubuntu:
  In Progress

Bug description:
  Binary package hint: initramfs-tools

  When generating a new initramfs there is no check for available free
  space, subsequently its possible for update-initramfs to fail due to a
  lack of free space.  This is resulting in package installation
  failures for initramfs-tools.  For example:

  Setting up initramfs-tools (0.98.8ubuntu3) ...
  update-initramfs: deferring update (trigger activated)
  Processing triggers for initramfs-tools ...
  update-initramfs: Generating /boot/initrd.img-2.6.38-8-generic

  gzip: stdout: No space left on device
  E: mkinitramfs failure cpio 141 gzip 1
  update-initramfs: failed for /boot/initrd.img-2.6.38-8-generic
  dpkg: error processing initramfs-tools (--configure):
   subprocess installed post-installation script returned error exit status 1

  WORKAROUND:

  Remove unused kernels using computer janitor (not in repositories for
  14.04 or later) or manually free space on your partition containing
  the /boot file system.

  See instructions here
  https://help.ubuntu.com/community/RemoveOldKernels

To manage notifications about this bug go to:
https://bugs.launchpad.net/initramfs-tools/+bug/798414/+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