Problemas com o apt-get install devido a múltiplas imagens linux?

3

Então, eu estava tentando instalar o python-numpy, mas recebi este erro:

masonscott@amory:~/Workspace/research/nsf-cogneuro-feb11$ sudo apt-get install python-numpy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-numpy is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-generic-lts-wily thermald
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-4.2.0-27-generic linux-image-4.2.0-34-generic
  linux-image-extra-4.2.0-27-generic linux-image-extra-4.2.0-34-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 423 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 202179 files and directories currently installed.)
Removing linux-image-extra-4.2.0-27-generic (4.2.0-27.32~14.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.2.0-27-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
Error! Your kernel headers for kernel 4.2.0-27-generic cannot be found.
Please install the linux-headers-4.2.0-27-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-27-generic
grep: /boot/config-4.2.0-27-generic: No such file or directory
WARNING: missing /lib/modules/4.2.0-27-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/4.2.0-27-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_W3v9Np/lib/modules/4.2.0-27-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_W3v9Np/lib/modules/4.2.0-27-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.2.0-27-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.2.0-27-generic (4.2.0-27.32~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-27-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: 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-4.2.0-27-generic.postrm line 328.
dpkg: error processing package linux-image-4.2.0-27-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.2.0-34-generic (4.2.0-34.39~14.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.2.0-34-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-34-generic
grep: /boot/config-4.2.0-34-generic: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_dC3KKx/lib/modules/4.2.0-34-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_dC3KKx/lib/modules/4.2.0-34-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.2.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.2.0-34-generic (4.2.0-34.39~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.2.0-34-generic /boot/vmlinuz-4.2.0-34-generic
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: 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-4.2.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-4.2.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-image-extra-4.2.0-27-generic
 linux-image-4.2.0-27-generic
 linux-image-extra-4.2.0-34-generic
 linux-image-4.2.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
masonscott@amory:~/Workspace/research/nsf-cogneuro-feb11$ 

Então, por alguma razão, parece que eu tenho 27 & amp; 34 imagens instaladas

e a saída de

uname -r

é

4.2.0-30-generic

e todo o material que está faltando na mensagem de erro como /boot/System.map-4.2.0 -... está corretamente instalado para 4.2.0-30, então não tenho certeza do que fazer

Depois de tentar remover a imagem de disco antiga com

sudo dpkg --purge ...

Estou recebendo este erro:

masonscott@amory:~$ sudo dpkg --purge linux-image-4.2.0-27-generic
(Reading database ... 202179 files and directories currently installed.)
Removing linux-image-4.2.0-27-generic (4.2.0-27.32~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-27-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.2.0-27-generic /boot/vmlinuz-4.2.0-27-generic
/usr/sbin/grub-mkconfig: 2: /etc/default/grub: Debian: 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-4.2.0-27-generic.postrm line 328.
dpkg: error processing package linux-image-4.2.0-27-generic (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.2.0-27-generic

Qual poderia ser o problema com isso?

    
por MASON CHAN SCOTT 17.03.2016 / 01:45

1 resposta

2

Sim, parece que você tem muitas imagens "MaxReports é alcançado"

Você precisa remover alguns kernels.

Aviso: A remoção de pacotes do kernel pode ser perigosa e pode até mesmo deixar o seu sistema incapaz de inicializar.

Verifique qual kernel você está usando:

uname -r

Não remova este kernel!

Listar todos os kernels instalados com:

dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)

Agora remova os kernels OLD corretos (mantenha um backup, se possível)

sudo dpkg --purge linux-image-4.2.0-15-generic

Onde a imagem corresponde ao seu antigo kernel

Em seguida, atualize & amp; atualizar

sudo apt-get update && sudo apt-get upgrade 

Em seguida, verifique se você tem o kernel atual

sudo apt-get install dist-upgrade 

Alternativa:

Uma alternativa é o Synaptic

sudo apt-get install synaptic

Após instalar e executar a pesquisa de programas:

linux-image

Clique com o botão direito do mouse em um kernel, escolha a remoção completa e, por fim, clique no botão Aplicar para excluir o kernel.

Repita a pesquisa, mas desta vez para o linux-header - você pode excluir os cabeçalhos associados para a imagem do kernel escolhida anteriormente.

Synaptic não tentará verificar o que você está tentando remover ... você pode inadvertidamente deletar seu kernel mais recente - ou até mesmo deletar todos os seus kernels através desta ferramenta deixando-o com um Ubuntu não inicializável!.

    
por DnrDevil 17.03.2016 / 02:04