Precisa de ajuda para remover o linux-image-3.16.0-34-generic e o linux-image-extra-3.16.0-34-generic

2

Então, eu me sinto como um burro ter que postar sobre isso, mas, eu preciso de ajuda para tentar corrigir esse problema, principalmente porque sem a correção não consigo instalar nenhum novo software ou executar atualizações. Por alguma razão, um dos kernals não deve ter sido totalmente desinstalado (linux-image-3.16.0-34-generic), então tentei fazer a primeira coisa que me veio à mente: apt-get -f install ... That falha e dá isso:

cictrone@cictrone:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 2 to remove and 14 not upgraded.
7 not fully installed or removed.
After this operation, 201 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 241430 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic:No such file or directory
depmod: FATAL: could not search modules: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
Error! echo
Your kernel headers for kernel 3.16.0-34-generic cannot be found at
/lib/modules/3.16.0-34-generic/build or /lib/modules/3.16.0-34-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
grep: /boot/config-3.16.0-34-generic: No such file or directory
WARNING: missing /lib/modules/3.16.0-34-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home    /cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu também tentei:

  1. sudo dpkg -C
  2. sudo apt-get autoremove
  3. sudo dpkg --remove
  4. sudo dpkg --configure -a
  5. sudo dpkg --remove --force-remove-reinstreq
  6. sudo apt-get autoclean

A saída do meu uname -r:

3.16.0-41-generic

A saída da sugestão de Terrance:

cictrone@cictrone:~$ sudo apt-get install linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-3.16.0-34-generic is already the newest version.
linux-image-3.16.0-34-generic is already the newest version.    
linux-image-extra-3.16.0-34-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
7 not fully installed or removed.
Need to get 0 B/53.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: error processing package linux-image-3.16.0-34-generic (--configure):
 package linux-image-3.16.0-34-generic is not ready for configuration
 cannot configure (current status 'half-installed')
Setting up linux-image-3.16.0-43-generic (3.16.0-43.58~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-3.16.0-43-generic) points to /boot/initrd.img-3.16.0-43-generic
 (/boot/initrd.img-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-3.16.0-43-generic) points to /boot/vmlinuz-3.16.0-43-generic
 (/boot/vmlinuz-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 1025.
dpkg: error processing package linux-image-3.16.0-43-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up grub-pc (2.02~beta2-9ubuntu1.3+elementary10~ubuntu0.3.1) ...
/var/lib/dpkg/info/grub-pc.config: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of linux-image-extra-3.16.0-43-generic:
 linux-image-extra-3.16.0-43-generic depends on linux-image-3.16.0-43-generic; however:
  Package linux-image-3.16.0-43-generic is not configured yet.

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

dpkg: error processing package linux-image-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-utopic:
 linux-generic-lts-utopic depends on linux-image-generic-No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
lts-utopic (= 3.16.0.43.34); however:
 Package linux-image-generic-lts-utopic is not configured yet.
dpkg: error processing package linux-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--configure):
 package linux-image-extra-3.16.0-34-generic is not ready for configuration
 cannot configure (current status 'half-installed')
    Errors were encountered while processing:
     linux-image-3.16.0-34-generic
     linux-image-3.16.0-43-generic
     grub-pc
     linux-image-extra-3.16.0-43-generic
     linux-image-generic-lts-utopic
     linux-generic-lts-utopic
     linux-image-extra-3.16.0-34-generic
    E: Sub-process /usr/bin/dpkg returned an error code (1)

O seguinte é a saída do comando remove depois de emitir o comando de reinstalação (apt-get):

cictrone@cictrone:~$ sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-headers-3.16.0-34
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  linux-headers-3.16.0-34-generic linux-image-3.16.0-34-generic
  linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 3 to remove and 15 not upgraded.
7 not fully installed or removed.
After this operation, 215 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 271286 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.16.0-34-generic/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-headers-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Esta ferramenta de ajustes do Ubuntu (foi capaz de obtê-lo instalado) também vê o kernel, mas dá os mesmos erros que o terminal.

Qualquer ajuda é apreciada, obrigado.

**** Resolvido ****

Descobriu-se que o problema do kernel não era a causa da manutenção do aptitude. Na verdade, foi grub.A linha em particular:

/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found

Eu fui para o arquivo e deletei a linha com o problema e, em seguida, executei as sugestões do Terrence e tudo foi corrigido! Obrigado a todos.

    
por Nicholas O'Brien 24.07.2015 / 19:25

3 respostas

1

Tente reinstalar esse kernel e, em seguida, remova-o.

Reinstalar:

sudo apt-get install --reinstall linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic

Remover:

sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
    
por Terrance 24.07.2015 / 20:09
0

Dê uma chance ao Ubuntu-Tweak . Ele remove kernels antigos bem para mim.

    
por Organic Marble 24.07.2015 / 20:37
0

Qual é o kernel em execução?

Você precisa prestar atenção nisso:

run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.
    
por RobinHood 25.07.2015 / 17:30