apt-get: não é capaz de instalar ou atualizar qualquer pacote [duplicado]

2

Estou usando o Ubuntu 12.04. Não consigo instalar ou atualizar nenhum pacote que eu tenha:

apt-get install traceroute
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-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Se eu tentar -f , me disseram que /boot está cheio:

apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-74 linux-image-3.2.0-74-generic linux-headers-3.2.0-74-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-generic linux-headers-generic linux-image-3.2.0-121-generic linux-image-generic
Suggested packages:
  fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
  linux-image-3.2.0-121-generic
The following packages will be upgraded:
  linux-generic linux-headers-generic linux-image-generic
3 upgraded, 1 newly installed, 0 to remove and 203 not upgraded.
10 not fully installed or removed.
Need to get 0 B/38.8 MB of archives.
After this operation, 151 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
........
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during './boot/vmlinuz-3.2.0-121-generic': No space left on device
No apport report written because the error message indicates a disk full error
                                                                              dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-121-generic /boot/vmlinuz-3.2.0-121-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.2.0-121-generic_3.2.0-121.164_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Meu /boot size:

/dev/sda1        92M   85M  1.9M  98% /boot

ls -ll
total 76775
-rw------- 1 root root  2884358 Apr 11  2012 System.map-3.2.0-23-generic
-rw------- 1 root root  2897962 Dec  9  2014 System.map-3.2.0-74-generic
-rw------- 1 root root  2898003 Dec 16  2014 System.map-3.2.0-75-generic
-rw------- 1 root root  2898466 Jan 13  2015 System.map-3.2.0-76-generic
-rw-r--r-- 1 root root   791023 Apr 11  2012 abi-3.2.0-23-generic
-rw-r--r-- 1 root root   796535 Dec  9  2014 abi-3.2.0-74-generic
-rw-r--r-- 1 root root   796535 Dec 16  2014 abi-3.2.0-75-generic
-rw-r--r-- 1 root root   796597 Jan 13  2015 abi-3.2.0-76-generic
-rw-r--r-- 1 root root   140279 Apr 11  2012 config-3.2.0-23-generic
-rw-r--r-- 1 root root   140790 Dec  9  2014 config-3.2.0-74-generic
-rw-r--r-- 1 root root   140790 Dec 16  2014 config-3.2.0-75-generic
-rw-r--r-- 1 root root   140790 Jan 13  2015 config-3.2.0-76-generic
drwxr-xr-x 3 root root     7168 Feb  1  2015 grub
-rw-r--r-- 1 root root 14177627 Apr  9  2014 initrd.img-3.2.0-23-generic
-rw-r--r-- 1 root root 14232258 Dec 11  2014 initrd.img-3.2.0-74-generic
-rw-r--r-- 1 root root 14233553 Feb  1  2015 initrd.img-3.2.0-75-generic
drwx------ 2 root root    12288 Nov 21  2013 lost+found
-rw-r--r-- 1 root root   176764 Nov 27  2011 memtest86+.bin
-rw-r--r-- 1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw------- 1 root root  4965840 Apr 11  2012 vmlinuz-3.2.0-23-generic
-rw------- 1 root root  4990768 Dec  9  2014 vmlinuz-3.2.0-74-generic
-rw------- 1 root root  4991088 Dec 16  2014 vmlinuz-3.2.0-75-generic
-rw------- 1 root root  4991856 Jan 13  2015 vmlinuz-3.2.0-76-generic

Eu tentei a solução aqui e outras soluções de limpeza de kernels antigas, mas recebi o seguinte erro:

$ uname -r
3.2.0-75-generic

$dpkg --list 'linux-image*' | grep ^ii
ii  linux-image-3.2.0-23-generic     3.2.0-23.36                         Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-74-generic     3.2.0-74.109                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-75-generic     3.2.0-75.110                        Linux kernel image for version 3.2.0 on 64 bit x86 SMP

$ apt-get remove linux-image-3.2.0-74-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-generic : Depends: linux-headers-generic (= 3.2.0.76.90) but 3.2.0.77.91 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Alguma ajuda, por favor?

Editar:

Eu tentei a solução aqui e removidos kernels antigos manualmente, mas agora eu recebo um problema de dependência diferente:

apt-get install -f
......

Generating grub.cfg ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.2.0-121-generic
Found initrd image: /boot/initrd.img-3.2.0-121-generic
Found linux image: /boot/vmlinuz-3.2.0-76-generic
Found initrd image: /boot/initrd.img-3.2.0-76-generic
Found linux image: /boot/vmlinuz-3.2.0-75-generic
Found initrd image: /boot/initrd.img-3.2.0-75-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-generic (3.2.0.121.136) ...
Setting up linux-headers-generic (3.2.0.121.136) ...
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

e o kernel atual ainda é "3.2.0-75-genérico"

    
por MohammedSimba 15.02.2017 / 12:19

1 resposta

2

Eu usei este questionar pois não consegui instalar nenhum pacote devido a falta de dependências devido a alguma atualização incorreta do kernel e o meu /boot estava quase cheio, tive que remover versões antigas do kernel manualmente e manter o último:

rm vmlinuz-3.2.0-xx-generic abi-3.2.0-xx-generic config-3.2.0-xx-generic initrd.img-3.2.0-xx-generic System.map-3.2.0-xx-generic

Não é uma solução de prática recomendada remover manualmente os arquivos, mas não consegui usar o APT ou dpkg .

Em seguida, executei apt-get install -f para corrigir dependências ausentes e instalar completamente o novo kernel, mas recebi o erro:

dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.76.90); however:
  Version of linux-image-generic on system is 3.2.0.121.136.
 linux-generic depends on linux-headers-generic (= 3.2.0.76.90); however:
  Version of linux-headers-generic on system is 3.2.0.121.136.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Então mudei para esta questão que tinha o mesmo problema e tentei reinstalar o kernel :

apt-get install --reinstall linux-generic=3.2.0.121.136 -f

Mas eu também tenho o mesmo problema,

Então, tentei usar dpkg :

# ls /var/cache/apt/archives/linux-generic*
/var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb

# dpkg --install /var/cache/apt/archives/linux-generic_3.2.0.121.136_amd64.deb
(Reading database ... 860860 files and directories currently installed.)
Preparing to replace linux-generic 3.2.0.121.136 (using .../linux-generic_3.2.0.121.136_amd64.deb) ...
Unpacking replacement linux-generic ...
Setting up linux-generic (3.2.0.121.136) ...

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

E tudo funcionou normalmente,

Obrigado a todos os comentários que me levaram a combinar todos esses posts para resolver meu problema @ Pilot6, @muru e @ user535733

    
por MohammedSimba 16.02.2017 / 13:12