Não é possível liberar espaço em / boot

2

Não tenho mais espaço em /boot devido a muitos kernels instalados. Então, estou tentando remover versões antigas do kernel, mas recebendo um erro:

$ sudo apt-get purge linux-headers-3.13.0-86
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-headers-3.13.0-86* linux-headers-3.13.0-86-generic*
0 upgraded, 0 newly installed, 2 to remove and 10 not upgraded.
2 not fully installed or removed.
After this operation, 76.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 435504 files and directories currently installed.)
Removing linux-headers-3.13.0-86-generic (3.13.0-86.131) ...
dpkg: warning: while removing linux-headers-3.13.0-86-generic, directory '/lib/modules/3.13.0-86-generic' not empty so not removed
Removing linux-headers-3.13.0-86 (3.13.0-86.131) ...
Setting up initramfs-tools (0.103ubuntu4.3) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-extra-4.2.0-41-generic (4.2.0-41.48~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-41-generic /boot/vmlinuz-4.2.0-41-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-41-generic /boot/vmlinuz-4.2.0-41-generic
Error! Module version v4.0.2_9000.20130911 for 8192cu.ko
is not newer than what is already found in kernel 4.2.0-41-generic (v4.0.2_9000.20130911).
You may override by specifying --force.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-41-generic /boot/vmlinuz-4.2.0-41-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-41-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.2.0-41-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.2.0-41-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for initramfs-tools (0.103ubuntu4.3) ...
update-initramfs: Generating /boot/initrd.img-4.2.0-42-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.2.0-42-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.2.0-41-generic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Qual é o problema aqui?

Atualizar : algo é estranho. Seguindo as instruções aqui eu fiz kernelver=$(uname -r | sed -r 's/-[a-z]+//'); dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print }' | grep -ve $kernelver e consegui

linux-headers-3.13.0-87
linux-headers-3.13.0-87-generic
linux-headers-3.13.0-91
linux-headers-3.13.0-91-generic
linux-headers-3.13.0-92
linux-headers-3.13.0-92-generic
linux-headers-4.2.0-27
linux-headers-4.2.0-27-generic
linux-headers-4.2.0-34
linux-headers-4.2.0-34-generic
linux-headers-4.2.0-36
linux-headers-4.2.0-36-generic
linux-headers-4.2.0-41
linux-headers-4.2.0-41-generic
linux-headers-4.2.0-42
linux-headers-4.2.0-42-generic
linux-image-4.2.0-36-generic
linux-image-4.2.0-41-generic
linux-image-4.2.0-42-generic

Mas ls /boot mostra

abi-4.2.0-35-generic                  lost+found
abi-4.2.0-36-generic                  memtest86+.bin
abi-4.2.0-41-generic                  memtest86+.elf
abi-4.2.0-42-generic                  memtest86+_multiboot.bin
config-4.2.0-35-generic               System.map-4.2.0-35-generic
config-4.2.0-36-generic               System.map-4.2.0-36-generic
config-4.2.0-41-generic               System.map-4.2.0-41-generic
config-4.2.0-42-generic               System.map-4.2.0-42-generic
efi                                   vmlinuz-4.2.0-35-generic
grub                                  vmlinuz-4.2.0-35-generic.efi.signed
initrd.img-4.2.0-35-generic           vmlinuz-4.2.0-36-generic
initrd.img-4.2.0-35-generic.old-dkms  vmlinuz-4.2.0-36-generic.efi.signed
initrd.img-4.2.0-36-generic           vmlinuz-4.2.0-41-generic
initrd.img-4.2.0-41-generic           vmlinuz-4.2.0-41-generic.efi.signed
initrd.img-4.2.0-41-generic.old-dkms  vmlinuz-4.2.0-42-generic
initrd.img-4.2.0-42-generic           vmlinuz-4.2.0-42-generic.efi.signed
initrd.img-4.2.0-42-generic.old-dkms

É por isso que tentei remover o linux-headers-3.13.0-87 mas parece que não está lá. O que estou fazendo errado?

    
por Johnny 18.07.2016 / 20:22

1 resposta

2

Os pacotes linux-headers-3.13.0-86 e linux-headers-3.13.0-86-generic foram removidos. Mas nenhum deles contém nenhum arquivo em /boot/ , então removê-los não ajudou aqui.

Depois de remover os dois pacotes, o apt tentou continuar a instalação pendente dos pacotes linux-image-extra-4.2.0-41-generic e initramfs-tools , que falharam, pois ainda não há espaço em /boot/ .

Você precisa remover alguns pacotes antigos de linux-image-* em vez do linux-headers-* .

    
por Florian Diesch 18.07.2016 / 20:43