Problema de dependência com a versão antiga do Ubuntu

4

Não consigo descobrir isso sozinho, espero que alguém possa ajudar.

Embora eu já esteja em 3.13.0-68-generic, sempre que executo uma atualização, recebo a mensagem de erro de que algo está errado com 3.13.0-58-generic.

(Eu sempre tenho que remover versões antigas devido à falta de espaço em disco na inicialização - sempre deixo o último e o último, quando removo os mais antigos).

O erro exato seria

Internal Error: Could not find image (/boot/vmlinuz-3.13.0-58-generic)
 dpkg: error processing package linux-image-3.13.0-58-generic (--configure):
  subprocess installed post-installation script returned error exit status 2 
  dpkg: dependency problems prevent configuration of
   linux-image-extra-3.13.0-58-generic: 
    linux-image-extra-3.13.0-58-generic depends on linux-image-3.13.0-58-generic;
    however: Package linux-image-3.13.0-58-generic is not configured yet.

 dpkg: error processing package linux-image-extra-3.13.0-58-generic (--configure):
  dependency problems - leaving unconfigured 

Errors were encountered while processing:
 linux-image-3.13.0-58-generic 
 linux-image-extra-3.13.0-58-generic

uname -a

olivy-ThinkPad-Edge 3.13.0-66-generic #108-Ubuntu SMP Wed Oct 7 15:20:27 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

ls -la /var/lib/dpkg/info/linux-image-*.postinst

-rwxr-xr-x 1 root root 39259 Dez  8  2014 /var/lib/dpkg/info/linux-image-3.13.0-43-generic.postinst
-rwxr-xr-x 1 root root 39259 Apr 10  2015 /var/lib/dpkg/info/linux-image-3.13.0-49-generic.postinst
-rwxr-xr-x 1 root root 39259 Mai  4  2015 /var/lib/dpkg/info/linux-image-3.13.0-52-generic.postinst
-rwxr-xr-x 1 root root 39259 Jun 18 03:04 /var/lib/dpkg/info/linux-image-3.13.0-55-generic.postinst
-rwxr-xr-x 1 root root 39259 Jun 19 12:05 /var/lib/dpkg/info/linux-image-3.13.0-57-generic.postinst
-rwxr-xr-x 1 root root 39259 Jul  8 05:54 /var/lib/dpkg/info/linux-image-3.13.0-58-generic.postinst
-rwxr-xr-x 1 root root 39259 Jul 29 14:36 /var/lib/dpkg/info/linux-image-3.13.0-61-generic.postinst
-rwxr-xr-x 1 root root 39259 Aug 11 18:19 /var/lib/dpkg/info/linux-image-3.13.0-62-generic.postinst
-rwxr-xr-x 1 root root 39259 Aug 15 01:09 /var/lib/dpkg/info/linux-image-3.13.0-63-generic.postinst
-rwxr-xr-x 1 root root 39259 Okt  3 01:57 /var/lib/dpkg/info/linux-image-3.13.0-65-generic.postinst
-rwxr-xr-x 1 root root 39259 Okt  7 18:36 /var/lib/dpkg/info/linux-image-3.13.0-66-generic.postinst
-rwxr-xr-x 1 root root 39259 Nov  6 20:59 /var/lib/dpkg/info/linux-image-3.13.0-68-generic.postinst
-rwxr-xr-x 1 root root   391 Dez  8  2014 /var/lib/dpkg/info/linux-image-extra-3.13.0-43-generic.postinst
-rwxr-xr-x 1 root root   391 Apr 10  2015 /var/lib/dpkg/info/linux-image-extra-3.13.0-49-generic.postinst
-rwxr-xr-x 1 root root   391 Mai  4  2015 /var/lib/dpkg/info/linux-image-extra-3.13.0-52-generic.postinst
-rwxr-xr-x 1 root root   391 Jun 18 03:04 /var/lib/dpkg/info/linux-image-extra-3.13.0-55-generic.postinst
-rwxr-xr-x 1 root root   391 Jun 19 12:05 /var/lib/dpkg/info/linux-image-extra-3.13.0-57-generic.postinst
-rwxr-xr-x 1 root root   391 Jul  8 05:54 /var/lib/dpkg/info/linux-image-extra-3.13.0-58-generic.postinst
-rwxr-xr-x 1 root root   391 Jul 29 14:36 /var/lib/dpkg/info/linux-image-extra-3.13.0-61-generic.postinst
-rwxr-xr-x 1 root root   391 Aug 11 18:19 /var/lib/dpkg/info/linux-image-extra-3.13.0-62-generic.postinst
-rwxr-xr-x 1 root root   391 Aug 15 01:09 /var/lib/dpkg/info/linux-image-extra-3.13.0-63-generic.postinst
-rwxr-xr-x 1 root root   391 Okt  3 01:57 /var/lib/dpkg/info/linux-image-extra-3.13.0-65-generic.postinst
-rwxr-xr-x 1 root root   391 Okt  7 18:36 /var/lib/dpkg/info/linux-image-extra-3.13.0-66-generic.postinst
-rwxr-xr-x 1 root root   391 Nov  6 20:59 /var/lib/dpkg/info/linux-image-extra-3.13.0-68-generic.postinst

Obrigado, muito!

    
por Olivia Fruitvegan Ladinig 16.11.2015 / 13:20

1 resposta

0

Em algum lugar no script de pós-instalação do pacote DEB ( /var/lib/dpkg/info/linux-image-3.13.0-58-generic.postinst ) está o snippet de código abaixo

die "Internal Error: Could not find image (" . $realimageloc
  . "$kimage-$version)\n" unless -e $realimageloc
  . "$kimage-$version";

significa que o script falha, se unless -e $realimageloc retornar false , ou em outras palavras, se o arquivo /boot/vmlinuz-3.13.0-58-generic não existir.

Duas possibilidades:

  • Crie um arquivo fictício

    sudo touch /boot/vmlinuz-3.13.0-58-generic
    
  • Executar

    sudo apt-get install -f
    

OR

  • Desative a instrução die

    • Edite o script de pós-instalação

      sudo nano /var/lib/dpkg/info/linux-image-3.13.0-58-generic.postinst
      
    • Pesquise o bloco de códigos

      die "Internal Error: Could not find image (" . $realimageloc
        . "$kimage-$version)\n" unless -e $realimageloc
        . "$kimage-$version";
      

      e comente as linhas, simplesmente adicione um # para cada linha

    • Você deve ver algo assim

      # Paranoid check to make sure that the correct value is put in there
      if    (! $kimage)                 { $kimage = "vmlinuz"; } # Hmm. empty
      elsif ($kimage =~ m/^b?uImage$/o) { $kimage = "vmlinuz"; } # these produce vmlinuz
      elsif ($kimage =~ m/^b?zImage$/o) { $kimage = "vmlinuz"; } # these produce vmlinuz
      elsif ($kimage =~ m/^[iI]mage$/o) { my $nop = $kimage;   }
      elsif ($kimage =~ m/^vmlinux$/o)  { my $nop = $kimage;   }
      else                              { $kimage = "vmlinuz"; } # Default
      
      $ENV{KERNEL_ARCH}=$kernel_arch if $kernel_arch;
      
      
      # die "Internal Error: Could not find image (" . $realimageloc
      #  . "$kimage-$version)\n" unless -e $realimageloc
      #  . "$kimage-$version";
      
      # search for the boot loader in the path
      my $loader_exec;
      ($loader_exec = $loader)  =~ s|.*/||;
      my ($loaderloc) = grep -x, map "$_/$loader_exec",
        map { length($_) ? $_ : "." }  split /:/, $ENV{PATH};
      
      
      ######################################################################
      ######################################################################
      ###########        Test whether a relative symlinkwould be OK #######
      ######################################################################
      ######################################################################
      ######################################################################
      
    • Salve o arquivo e execute

      sudo apt-get install -f
      
por A.B. 16.11.2015 / 14:17