Problemas ao atualizar o kernel no Ubuntu 14.04

1

Estou tendo problemas com a atualização do meu kernel executando o Ubuntu 14.04 no kernel 4.4.0-45-generic. Quando executo apt-get update seguido por apt-get upgrade , minha unidade / boot fica sem espaço. Eu vou olhar para o / boot e ver que ele instalou o initrd.img-3.19.0-64-generic através do initrd.img-3.19.0-73-generic, o que parece desnecessário.

Com base nos outros arquivos em / boot e no kernel que estou executando agora, acho que deveria estar em initrd.img-4.4.0-57-generic. Portanto, não tenho certeza porque upgrade está instalando todos esses initrd.img desnecessários (ele não instala nenhum dos outros arquivos para os kernels mais antigos).

Seguindo os conselhos em vários lugares sobre como limpar / inicializar, eu apaguei manualmente os arquivos initrd.img mais antigos e executei novamente o apt-get upgrade . Novamente, ele baixa e instala os mesmos pacotes initrd, fica sem espaço e falha. Como posso corrigir apt upgrade ? Como evitar que ele instale kernels antigos? Qualquer ajuda seria muito apreciada. Caso seja útil, aqui está a saída completa de apt-get upgrade :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic-lts-vivid linux-generic-lts-xenial
  linux-headers-generic-lts-vivid linux-headers-generic-lts-xenial
  linux-image-generic-lts-vivid linux-image-generic-lts-xenial
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
10 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up initramfs-tools (0.103ubuntu4.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.19.0-78-generic (3.19.0-78.86~14.04.1) ...
Internal Error: Could not find image (/boot/vmlinuz-3.19.0-78-generic)
dpkg: error processing package linux-image-3.19.0-78-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up linux-firmware (1.127.23) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-42-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-38-generic
grep: /boot/config-4.4.0-38-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-73-generic
grep: /boot/config-3.19.0-73-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-71-generic
grep: /boot/config-3.19.0-71-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-69-generic
grep: /boot/config-3.19.0-69-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-66-generic
grep: /boot/config-3.19.0-66-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-65-generic
grep: /boot/config-3.19.0-65-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-64-generic
grep: /boot/config-3.19.0-64-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-61-generic
grep: /boot/config-3.19.0-61-generic: No such file or directory

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.19.0-61-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-extra-3.19.0-78-generic:
 linux-image-extra-3.19.0-78-generic depends on linux-image-3.19.0-78-generic; however:
  Package linux-image-3.19.0-78-generic is not configured yet.

dpkg: error processing package linux-image-extra-3.19.0-78-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-lts-vivid:
 linux-image-generic-lts-vivid depends on linux-image-3.19.0-78-generic; however:
  Package linux-image-3.19.0-78-generic is not configured yet.
 linux-image-generic-lts-vivid depends on linux-image-extra-3.19.0-78-generic; however:
  Package linux-image-extra-3.19.0-78-generic is not configured yet.
 linux-image-generic-lts-vivid depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic-lts-vivid (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problNo apport report written because the error message indicates its a followup error from a previous failure.
                   No apport report written because MaxReports is reached already
                                                                                 No apport report written because MaxReports is reached already
                                      ems prevent configuration of linux-generic-lts-vivid:
 linux-generic-lts-vivid depends on linux-image-generic-lts-vivid (= 3.19.0.78.60); however:
  Package linux-image-generic-lts-vivid is not configured yet.

dpkg: error processing package linux-generic-lts-vivid (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-4.4.0-57-generic (4.4.0-57.78~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-57-generic
vmlinuz(/boot/vmlinuz-4.4.0-57-generic
) points to /boot/vmlinuz-4.4.0-57-generic
 (/boot/vmlinuz-4.4.0-57-generic) -- doing nothing at     /var/lib/dpkg/info/linux-image-4.4.0-57-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-57-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-57-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-57-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-57-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                          dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-57-generic:
 linux-image-extra-4.4.0-57-generic depends on linux-image-4.4.0-57-generic; however:
  Package linux-image-4.4.0-57-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-57-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          No apport report written because MaxReports is reached already
               dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
 linux-image-generic-lts-xenial depends on linux-image-4.4.0-57-generic; however:
  Package linux-image-4.4.0-57-generic is not configured yet.
 linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-57-generic; however:
  Package linux-image-extra-4.4.0-57-generic is not configured yet.
 linux-image-generic-lts-xenial depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-xenial:
 linux-generic-lts-xenial depends on linux-image-generic-lts-xenial (= 4.4.0.57.44); however:
  Package linux-image-generic-lts-xenial is not configured yet.

dpkg: error processing package linux-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          Processing triggers for initramfs-tools (0.103ubuntu4.6) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic

 gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-45-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                          Errors were encountered while processing:
 linux-image-3.19.0-78-generic
 linux-firmware
 linux-image-extra-3.19.0-78-generic
 linux-image-generic-lts-vivid
 linux-generic-lts-vivid
 linux-image-4.4.0-57-generic
 linux-image-extra-4.4.0-57-generic
 linux-image-generic-lts-xenial
 linux-generic-lts-xenial
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT1: Eu tentei remover kernels antigos como descrito aqui .

Falhou com a mensagem de erro:

Errors were encountered while processing:
 linux-image-extra-3.19.0-64-generic
 linux-image-extra-3.19.0-65-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:

Encontrei então um problema muito semelhante que pode ser o mesmo ou semelhante ao que estou experimentando. Remover manualmente todos os linux-image-3.19.* de /var/lib/dpkg/info/ seria uma opção? Eu não estou imaginando, mas não sei mais o que fazer.

    
por mpmbq2 14.01.2017 / 23:38

2 respostas

0

Tente isto:

Abra um terminal

Pressione Ctrl + Alt + T

Execute:

sudo -i
dpkg --configure -a
apt-get update
apt-get -f install
OLDCONF=$(dpkg -l|grep “^rc”|awk ‘{print $2}’)
CURKERNEL=$(uname -r|sed ‘s/-*[a-z]//g’|sed ‘s/-386//g’)
LINUXPKG=”linux-(image|headers|ubuntu-modules|restricted-modules)”
METALINUXPKG=”linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)”
OLDKERNELS=$(dpkg -l|awk ‘{print $2}’|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
apt-get clean
apt-get purge $OLDCONF
apt-get purge $OLDKERNELS
apt-get autoremove
apt-get dist-upgrade
apt-get clean
    
por kyodake 15.01.2017 / 00:06
0

Eu consertei esse problema usando o synaptic para deletar kernels antigos como descrito aqui . O processo de exclusão falhou várias vezes porque um arquivo initrd.img-x.xx.x-xx-generic.old-dkms foi criado para cada kernel que está sendo excluído, o que causou a falta da minha partição /boot . Eu removi manualmente esse arquivo para liberar espaço e reiniciei a remoção. Todas as atualizações e atualizações parecem estar funcionando bem agora.

    
por mpmbq2 16.01.2017 / 20:17