PDA

View Full Version : Unattended upgrades failed due to diskspace in /boot. How to reinstall&reconfig?



soonthorn.ios
March 24th, 2015, 06:33 PM
Hi,

System info


root@node-011:/# cat /etc/issue
Ubuntu 14.04.1 LTS \n \l


root@node-011:/# cat /proc/version_signature
Ubuntu 3.13.0-34.60-generic 3.13.11.4




Our unattended upgrade failed due to no space left in /boot .



unattended-upgrades-dpkg_2015-03-24_06:41:23.459705.log
(Reading database ... 221703 files and directories currently installed.)
Preparing to unpack .../libgnutls-openssl27_2.12.23-12ubuntu2.2_amd64.deb ...
Unpacking libgnutls-openssl27:amd64 (2.12.23-12ubuntu2.2) over (2.12.23-12ubuntu2.1) ...
Preparing to unpack .../libgnutls26_2.12.23-12ubuntu2.2_amd64.deb ...
Unpacking libgnutls26:amd64 (2.12.23-12ubuntu2.2) over (2.12.23-12ubuntu2.1) ...
Selecting previously unselected package linux-image-3.13.0-48-generic.
Preparing to unpack .../linux-image-3.13.0-48-generic_3.13.0-48.80_amd64.deb ...
Done.
Unpacking linux-image-3.13.0-48-generic (3.13.0-48.80) ...
Selecting previously unselected package linux-image-extra-3.13.0-48-generic.
Preparing to unpack .../linux-image-extra-3.13.0-48-generic_3.13.0-48.80_amd64.deb ...
Unpacking linux-image-extra-3.13.0-48-generic (3.13.0-48.80) ...
Preparing to unpack .../linux-generic_3.13.0.48.55_amd64.deb ...
Unpacking linux-generic (3.13.0.48.55) over (3.13.0.46.53) ...
Preparing to unpack .../linux-image-generic_3.13.0.48.55_amd64.deb ...
Unpacking linux-image-generic (3.13.0.48.55) over (3.13.0.46.53) ...
Selecting previously unselected package linux-headers-3.13.0-48.
Preparing to unpack .../linux-headers-3.13.0-48_3.13.0-48.80_all.deb ...
Unpacking linux-headers-3.13.0-48 (3.13.0-48.80) ...
Selecting previously unselected package linux-headers-3.13.0-48-generic.
Preparing to unpack .../linux-headers-3.13.0-48-generic_3.13.0-48.80_amd64.deb ...
Unpacking linux-headers-3.13.0-48-generic (3.13.0-48.80) ...
Preparing to unpack .../linux-headers-generic_3.13.0.48.55_amd64.deb ...
Unpacking linux-headers-generic (3.13.0.48.55) over (3.13.0.46.53) ...
Setting up libgnutls26:amd64 (2.12.23-12ubuntu2.2) ...
Setting up libgnutls-openssl27:amd64 (2.12.23-12ubuntu2.2) ...
Setting up linux-image-3.13.0-48-generic (3.13.0-48.80) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-48-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found linux image: /boot/vmlinuz-3.13.0-46-generic
Found initrd image: /boot/initrd.img-3.13.0-46-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-43-generic
Found initrd image: /boot/initrd.img-3.13.0-43-generic
Found linux image: /boot/vmlinuz-3.13.0-40-generic
Found initrd image: /boot/initrd.img-3.13.0-40-generic
Found linux image: /boot/vmlinuz-3.13.0-39-generic
Found initrd image: /boot/initrd.img-3.13.0-39-generic
Found linux image: /boot/vmlinuz-3.13.0-34-generic
Found initrd image: /boot/initrd.img-3.13.0-34-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-extra-3.13.0-48-generic (3.13.0-48.80) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-48-generic /boot/vmlinuz-3.13.0-48-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-48-generic


gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.13.0-48-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-48-generic (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-extra-3.13.0-48-generic; however:
Package linux-image-extra-3.13.0-48-generic is not configured yet.


dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
Setting up linux-headers-3.13.0-48 (3.13.0-48.80) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up linux-headers-3.13.0-48-generic (3.13.0-48.80) ...
Setting up linux-headers-generic (3.13.0.48.55) ...
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.13.0.48.55); however:
Package linux-image-generic is not configured yet.


dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
linux-image-extra-3.13.0-48-generic
linux-image-generic
linux-generic
Error in function:




We have cleaned up /boot by running apt-get purge on some unused versions (we keep the current running one and the two latest ones).

apt-get purge linux-headers-3.13.0-XX linux-headers-3.13.0-XX-generic linux-image-3.13.0-XX-generic linux-image-extra-3.13.0-XX-generic

Based on the log file, it said
Errors were encountered while processing:
linux-image-extra-3.13.0-48-generic
linux-image-generic
linux-generic

My questions are

1.
What is the proper way to re-install/upgrade/config those packages?
Is the following command enough?


apt-get install --reinstall linux-image-extra-3.13.0-48-generic linux-image-generic linux-generic

I noticed that in unattened-upgrades log that there are errors during update-initramfs, run-parts, post installation script, configuration scripts.
Do I need to run other command after apt-get --reinstall those packages so that they are configured propertly?

2.
What exactly commands are run via unattended-upgrades? And how do I disable auto unattended-upgrades?

Thank you for your help.

ian-weisser
March 24th, 2015, 06:44 PM
Are you, by chance, using LVM, encrypted disk, or another feature that requires a separate /boot partition?
There is a known bug that autoremoval of old kernels on separate /boot seems to be broken. Help locating and fixing the bug is welcome.

1) After you have freed some space by removing old kernel packages, simply re-run the upgrade.
If you specify a package to install, it will not be eligible for future auto-removal. In a few weeks, when the next kernel upgrade comes out, this will make your space problem worse.

2) Unattended-upgrades installs your security updates. With changed settings, it can be used for much more than that.
Best practice is to leave it enabled. If you are suffering from the separate /boot bug, then occasionally clean old kernels out of /boot manually.

Impavidus
March 24th, 2015, 07:57 PM
You could try a lower level command to purge those old kernels:
dpkg -P package1 package2(with root permissions of course, but I see you prefer a root terminal over sudo)
dpkg will uninstall a package without checking for broken stuff elsewhere. A great way to break your system, but also to fix it.