Não é possível remover Kernels antigos do disco de inicialização completa

1

Não consigo instalar ou atualizar nenhum software na minha máquina.

Usando meus incríveis poderes de dedução, deduzi que / boot estava cheio e estava causando toda minha mágoa.

notlinus @ NS0: / boot $ df -h

Filesystem                Size  Used Avail Use% Mounted on
udev                      2.0G  4.0K  2.0G   1% /dev
tmpfs                     396M  656K  395M   1% /run
/dev/mapper/NS0--vg-root   36G  3.6G   30G  11% /
none                      4.0K     0  4.0K   0% /sys/fs/cgroup
none                      5.0M     0  5.0M   0% /run/lock
none                      2.0G     0  2.0G   0% /run/shm
none                      100M     0  100M   0% /run/user
/dev/sda1                 236M  234M     0 100% /boot

notlinus @ NS0: / boot $ ls -l

total 229780
-rw-r--r-- 1 root root  1270654 Aug 12  2015 abi-3.19.0-26-generic
-rw-r--r-- 1 root root  1271100 Sep  1  2015 abi-3.19.0-28-generic
-rw-r--r-- 1 root root  1271518 Oct  3 00:54 abi-3.19.0-30-generic
-rw-r--r-- 1 root root  1271689 Oct  8 13:01 abi-3.19.0-31-generic
-rw-r--r-- 1 root root  1271689 Oct 22 13:14 abi-3.19.0-32-generic
-rw-r--r-- 1 root root  1271689 Nov  6 20:39 abi-3.19.0-33-generic
-rw-r--r-- 1 root root  1271691 Nov 23 16:57 abi-3.19.0-37-generic
-rw-r--r-- 1 root root   177632 Aug 12  2015 config-3.19.0-26-generic
-rw-r--r-- 1 root root   177651 Sep  1  2015 config-3.19.0-28-generic
-rw-r--r-- 1 root root   177730 Oct  3 00:54 config-3.19.0-30-generic
-rw-r--r-- 1 root root   177790 Oct  8 13:01 config-3.19.0-31-generic
-rw-r--r-- 1 root root   177790 Oct 22 13:14 config-3.19.0-32-generic
-rw-r--r-- 1 root root   177790 Nov  6 20:39 config-3.19.0-33-generic
-rw-r--r-- 1 root root   177790 Nov 23 16:57 config-3.19.0-37-generic
drwxr-xr-x 5 root root     1024 Feb 17 13:47 grub
-rw-r--r-- 1 root root 20754747 Aug 27  2015 initrd.img-3.19.0-26-generic
-rw-r--r-- 1 root root 20753554 Sep  9 06:29 initrd.img-3.19.0-28-generic
-rw-r--r-- 1 root root 20756217 Oct  6 07:03 initrd.img-3.19.0-30-generic
-rw-r--r-- 1 root root 20758684 Oct 22 13:04 initrd.img-3.19.0-31-generic
-rw-r--r-- 1 root root 20757000 Nov  5 06:55 initrd.img-3.19.0-32-generic
-rw-r--r-- 1 root root 20758873 Nov 10 07:17 initrd.img-3.19.0-33-generic
-rw-r--r-- 1 root root 20757964 Dec  2 06:54 initrd.img-3.19.0-37-generic
-rw-r--r-- 1 root root  3463561 Feb 17 13:46 initrd.img-3.19.0-39-generic
-rw-r--r-- 1 root root  3463563 Feb 17 13:47 initrd.img-3.19.0-42-generic
drwx------ 2 root root    12288 Aug 27  2015 lost+found
-rw-r--r-- 1 root root   176500 Mar 12  2014 memtest86+.bin
-rw-r--r-- 1 root root   178176 Mar 12  2014 memtest86+.elf
-rw-r--r-- 1 root root   178680 Mar 12  2014 memtest86+_multiboot.bin
-rw------- 1 root root  3626965 Aug 12  2015 System.map-3.19.0-26-generic
-rw------- 1 root root  3626779 Sep  1  2015 System.map-3.19.0-28-generic
-rw------- 1 root root  3627906 Oct  3 00:54 System.map-3.19.0-30-generic
-rw------- 1 root root  3628177 Oct  8 13:01 System.map-3.19.0-31-generic
-rw------- 1 root root  3628149 Oct 22 13:14 System.map-3.19.0-32-generic
-rw------- 1 root root  3628149 Nov  6 20:39 System.map-3.19.0-33-generic
-rw------- 1 root root  3628776 Nov 23 16:57 System.map-3.19.0-37-generic
-rw------- 1 root root  6570192 Aug 12  2015 vmlinuz-3.19.0-26-generic
-rw------- 1 root root  6568848 Sep  1  2015 vmlinuz-3.19.0-28-generic
-rw------- 1 root root  6572496 Oct  3 00:54 vmlinuz-3.19.0-30-generic
-rw------- 1 root root  6572336 Oct  8 13:01 vmlinuz-3.19.0-31-generic
-rw------- 1 root root  6572944 Oct 22 13:14 vmlinuz-3.19.0-32-generic
-rw------- 1 root root  6572432 Nov  6 20:39 vmlinuz-3.19.0-33-generic
-rw------- 1 root root  6571920 Nov 23 16:57 vmlinuz-3.19.0-37-generic

notlinus @ NS0: / boot $ uname -r

3.19.0-37-generic

notlinus @ NS0: ~ $ sudo apt-get clean

notlinus @ NS0: / boot $ sudo apt-get autoremove

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies.
 linux-image-extra-3.19.0-49-generic : Depends: linux-image-3.19.0-49-generic but it is not installed
 linux-image-generic-lts-vivid : Depends: linux-image-3.19.0-49-generic but it is not installed
                                 Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.

notlinus @ NS0: / boot $ sudo dpkg --list 'linux-image*'

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                Version                Architecture           Description
+++-===================================-======================-======================-===========================================================================
un  linux-image                         <none>                 <none>                 (no description available)
un  linux-image-3.0                     <none>                 <none>                 (no description available)
rc  linux-image-3.19.0-25-generic       3.19.0-25.26~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-26-generic       3.19.0-26.28~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-28-generic       3.19.0-28.30~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-30-generic       3.19.0-30.34~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-31-generic       3.19.0-31.36~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-32-generic       3.19.0-32.37~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-33-generic       3.19.0-33.38~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-3.19.0-37-generic       3.19.0-37.42~14.04.1   amd64                  Linux kernel image for version 3.19.0 on 64 bit x86 SMP
in  linux-image-3.19.0-39-generic       <none>                 amd64                  (no description available)
in  linux-image-3.19.0-42-generic       <none>                 amd64                  (no description available)
in  linux-image-3.19.0-49-generic       <none>                 amd64                  (no description available)
rc  linux-image-extra-3.19.0-25-generic 3.19.0-25.26~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-26-generic 3.19.0-26.28~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-28-generic 3.19.0-28.30~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-30-generic 3.19.0-30.34~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-31-generic 3.19.0-31.36~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-32-generic 3.19.0-32.37~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
ii  linux-image-extra-3.19.0-33-generic 3.19.0-33.38~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
iF  linux-image-extra-3.19.0-37-generic 3.19.0-37.42~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
iU  linux-image-extra-3.19.0-49-generic 3.19.0-49.55~14.04.1   amd64                  Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP
iU  linux-image-generic-lts-vivid       3.19.0.49.34           amd64                  Generic Linux kernel image

notlinus @ NS0: / boot $ sudo apt-get remove linux-image-3.19.0-26-generic

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 linux-image-extra-3.19.0-26-generic : Depends: linux-image-3.19.0-26-generic but it is not going to be installed
 linux-image-extra-3.19.0-49-generic : Depends: linux-image-3.19.0-49-generic but it is not going to be installed
 linux-image-generic-lts-vivid : Depends: linux-image-3.19.0-49-generic but it is not going to be installed
                                 Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Tenho certeza de que essa deve ser uma pergunta duplicada, mas depois de pesquisar as soluções para perguntas semelhantes, não aliviamos minha situação.

Por último, eu sou um administrador do RHEL, então, por favor, desculpe a minha ignorância adequada - nossos servidores BIND têm que estar no Ubuntu como uma condição de algum espaço livre da nossa companhia irmã. O que estou fazendo de errado que causou esse problema e como posso evitar que isso aconteça no futuro?

Quando eu tento soluções semelhantes neste site, como Como libero mais espaço em / boot? eu recebo:

notlinus@NS0:/boot$ sudo dpkg -fl linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print }' | grep -v -e 'uname -r | cut -f1,2 -d"-"' | grep -e '[0-9]' | xargs sudo apt-get -y purge
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies.
 linux-image-extra-3.19.0-26-generic : Depends: linux-image-3.19.0-26-generic but it is not installed
 linux-image-extra-3.19.0-28-generic : Depends: linux-image-3.19.0-28-generic but it is not installed
 linux-image-extra-3.19.0-30-generic : Depends: linux-image-3.19.0-30-generic but it is not installed
 linux-image-extra-3.19.0-31-generic : Depends: linux-image-3.19.0-31-generic but it is not installed
 linux-image-extra-3.19.0-32-generic : Depends: linux-image-3.19.0-32-generic but it is not installed
 linux-image-extra-3.19.0-33-generic : Depends: linux-image-3.19.0-33-generic but it is not installed
 linux-image-extra-3.19.0-49-generic : Depends: linux-image-3.19.0-49-generic but it is not installed
 linux-image-generic-lts-vivid : Depends: linux-image-3.19.0-49-generic but it is not installed
                                 Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.
    
por AirCombat 04.03.2016 / 12:00

2 respostas

4

Obrigado @mikewhatever,

sudo dpkg --force-all -P pkgname foi a resposta

Então: sudo dpkg --force-all -P linux-image-extra-3.19.0-26-generic fez isso por mim

    
por AirCombat 04.03.2016 / 15:11
0

Desde o Ubuntu 14.04 Trusty, este comando suporta kernels antigos, exceto os dois últimos. É muito fácil e seguro remover kernels antigos que não sejam os últimos 2 digitando em um terminal o comando:

sudo apt-get autoremove --purge
    
por Yolateng0 04.03.2016 / 14:47