Autoupdater fills /boot and crashes because old kernel images are never removed

Bug #1054927 reported by Henri Sivonen
66
This bug affects 15 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Ubuntu)
Fix Released
Undecided
Michael Vogt

Bug Description

Steps to reproduce:
1) Install Ubuntu with the default LVM encryption recipe
2) Set Ubuntu to automatically install security updates on the background
3) Use ubuntu for 5 months

Actual results:
The system automatically installs security updates for the kernel under /boot. It's never removes previous kernel images. After about five months, the /boot partition created by the install recipe (i.e. sized according to the judgment of Ubuntu developers—not me) fills up and the unattended updater crashes during the next kernel update.

Expected results:
Expected the unattended updater to leave the nearest kernel and the previous one on /boot and to automatically remove older kernel images. Expected the system installer to set up /boot such that it never runs out of space when the system updater operates automatically.

For workaround and sytem repair, see
https://help.ubuntu.com/community/Lubuntu/Documentation/RemoveOldKernels

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: update-manager 1:0.156.14.9
ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
Uname: Linux 3.2.0-31-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
Date: Sun Sep 23 12:53:52 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitecture: all
SourcePackage: update-manager
UpgradeStatus: No upgrade log present (probably fresh install)

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

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

Changed in update-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
garyx (garyx) wrote :

This affects all my servers that I run and I regularly need to fix the apt security updates because it fills the /boot folder. This affects a lot of people and if you google "Ubuntu full /boot" you will see that this affects a lot of people. If not all installations of Ubuntu servers where automatic security updates are enabled.

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 :

It also affects desktop users and users who install kernels "manually" by Software Updater (update-manager).

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

Corrective to my previous comment: If one installs kernels by Software Updater, /boot becomes full in time by default thus preventing installation of the new kernel. Bug #1389620

Jarno Suni (jarnos)
description: updated
Adam Conrad (adconrad)
Changed in unattended-upgrades (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Changed in update-manager (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Revision history for this message
Michael Vogt (mvo) wrote :

The unattended-upgrades part is fixed by the latest 0.90 version of unattended-upgrades.

Changed in unattended-upgrades (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sebastian Nohn (sebastian-nohn) wrote :

Fix seems not released. My disk is again cluttered with old kernels.

Revision history for this message
Sebastian Nohn (sebastian-nohn) wrote :

$ sudo apt-get remove --purge linux-headers-3.16.0-57 linux-headers-3.16.0-57-generic linux-headers-3.16.0-59 linux-headers-3.16.0-59-generic linux-headers-3.16.0-60 linux-headers-3.16.0-60-generic linux-headers-3.16.0-62 linux-headers-3.16.0-62-generic linux-image-3.16.0-62-generic linux-image-extra-3.16.0-62-generic linux-signed-image-3.16.0-62-generic
[sudo] password for sebastian:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
  linux-headers-3.16.0-57* linux-headers-3.16.0-57-generic*
  linux-headers-3.16.0-59* linux-headers-3.16.0-59-generic*
  linux-headers-3.16.0-60* linux-headers-3.16.0-60-generic*
  linux-headers-3.16.0-62* linux-headers-3.16.0-62-generic*
  linux-image-3.16.0-62-generic* linux-image-extra-3.16.0-62-generic*
  linux-signed-image-3.16.0-62-generic*
0 to upgrade, 0 to newly install, 11 to remove and 9 not to upgrade.
After this operation, 515 MB disk space will be freed.
Do you want to continue? [Y/n]

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

Sebastian Nohn, I suppose the bug is fixed since Xenial (16.04) only. Even then kernels are not purged but removed. In older releases you have to follow the instructions in the page linked to the bug description. I wonder if you have more "headers" packages than "image" packages remaining in your system; at least you are about to purge more "headers" packages in above command.

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

Also Bug #1440608 should be fixed to get the expected results.

Revision history for this message
Sebastian Nohn (sebastian-nohn) wrote :

Jarno Suni, OK. Too bad. My interpretation was, this is also fixed in 14.04. For some reason I don't know more header packages were installed than image packages. My guess is this is because of some incomplete manual kernel removal, I executed in the past.

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

Sebastian Nohn, it is not hard to enable automatic removing of old kernels by the instructions. Alternatively you could run "purge-old-kernels -y" script automatically during boot in /etc/rc.local, though the script is not perfect either (see Bug #1532153 and Bug #1569228)

Revision history for this message
Jonathan (desertshadow) wrote :

I am unable to update to Ubuntu 16.04 because of this problem. GParted will not let me expand the size of boot. Running sudo apt-get clean does not fix the issue.

Revision history for this message
Jonathan (desertshadow) wrote :

This is some commands that will auto-detect your kernal and remove the old ones. Follow carefully

http://askubuntu.com/a/259092/114641

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

Jonathan, there are alternative instructions linked to the description.

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

I marked this as a duplicate of Bug #1357093 and not vice verse because this description does not cover the case where security updates are installed using Software Updater or e.g. apt-get dist-upgrade instead of by unattended-upgrades.

Mathew Hodson (mhodson)
no longer affects: update-manager (Ubuntu)
Revision history for this message
Richard L Cooper (richardlc) wrote :

I have the same bug in Xenial: reported today on request from Jarnos in bug #798414 on 2016-05-26
Fixed in Ubuntu Tweaks Janitor yesterday. Now I have plenty of room in boot partition.

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

Richard L Cooper, did you sometimes install new kernels by Software Updater or e.g. by 'sudo apt-get dist-upgrade'? If so, you were affected by Bug #1624644.

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.