Kernel Linux - eu errei removendo versões antigas

1

Eu estava tentando remover kernels antigos usando o Synaptic, e algo deu muito errado. Agora, eu recebo este erro no Synaptic se eu tentar consertá-lo:

    (synaptic:11810): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
dpkg: warning: files list file for package 'refind' missing; assuming package has no files currently installed
(Reading database ... 338732 files and directories currently installed.)
Removing linux-image-extra-3.19.0-21-generic (3.19.0-21.21) ...
depmod: FATAL: could not load /boot/System.map-3.19.0-21-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
Error! Your kernel headers for kernel 3.19.0-21-generic cannot be found.
Please install the linux-headers-3.19.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-21-generic /boot/vmlinuz-3.19.0-21-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-21-generic
grep: /boot/config-3.19.0-21-generic: No such file or directory
cp: cannot stat ‘/lib/modules/3.19.0-21-generic/kernel/drivers/hid/usbhid/usbhid.ko’: No such file or directory
modinfo: ERROR: Module /lib/modules/3.19.0-21-generic/kernel/drivers/hid/usbhid/usbhid.ko not found.

E sempre que tento instalar ou atualizar no terminal, recebo uma sequência completa de erros, terminando com isso:

cp: cannot stat ‘/lib/modules/3.19.0-22-generic/kernel/drivers/firewire/firewire-sbp2.ko’: No such file or directory
modinfo: ERROR: Module /lib/modules/3.19.0-22-generic/kernel/drivers/firewire/firewire-sbp2.ko not found.
cp: cannot stat ‘/lib/modules/3.19.0-22-generic/kernel/ubuntu/aufs/aufs.ko’: No such file or directory
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.19.0-22-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.19.0-22-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.19.0-21-generic
 linux-image-extra-3.19.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

O Synaptic diz que eu preciso instalar o pacote linux-headers-3.19.0-22-generic , mas quando eu tento no terminal, ele diz Package 'linux-headers-3.19.0-22-generic' has no installation candidate .

Eu corri sudo dpkg --audit , o que deu o seguinte:

The following packages are only half installed, due to problems during
installation.  The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
 linux-image-extra-3.19.0-21-generic Linux kernel extra modules for version 3.1
 linux-image-extra-3.19.0-22-generic Linux kernel extra modules for version 3.1

Obviamente, eu estraguei alguma coisa. O Synaptic não corrigirá e nem sudo apt-get install -f nem sudo dpkg --configure -a ajudam. Eu não tenho certeza do que fazer! Ajuda ??!

    
por Rsync 27.03.2016 / 03:38

1 resposta

4

Eu consertei manualmente por:

PASSO 1 :

sudo cp /var/lib/dpkg/status /var/lib/dpkg/status.bak

gksu gedit /var/lib/dpkg/status
  • exclua manualmente as entradas para 3.19.0-21-genéricas e 3.19.0-22-genéricas
  • salvar

ETAPA 2:

sudo rm -r '/lib/modules/3.19.0-21-generic'

sudo rm -r '/lib/modules/3.19.0-22-generic'

Em seguida, executei um sudo apt-get update e sudo apt-get upgrade . Tudo agora funcionando!

    
por Rsync 28.03.2016 / 00:42