Como faço para limpar a lista de remoção do apt-get?

1

apt-get upgrade mostra que um pacote deve ser removido:

gradinafrica@host:~$ sudo apt-get upgrade
[sudo] password for gradinafrica:
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-extra-3.13.0-61-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 152 MB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Este pacote nunca é removido e não acho que precise ser. Como posso obter apt-get para parar de tentar removê-lo?

EDITAR:

Saída de sudo apt-get -y upgrade :

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  linux-image-extra-3.13.0-61-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 152 MB disk space will be freed.
(Reading database ... 35514 files and directories currently installed.)
Removing linux-image-extra-3.13.0-61-generic (3.13.0-61.100) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-61-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-61-generic
grep: /boot/config-3.13.0-61-generic: No such file or directory
WARNING: missing /lib/modules/3.13.0-61-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.13.0-61-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.13.0-61-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-3.13.0-61-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.13.0-61-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT 2:

Baixou o pacote de 64-bit para o linux-image-3.13.0-61-generic e tentou instalá-lo usando sudo dpkg -i linux-image-3.13.0-61-generic_3.13.0-61.100_amd64.deb :

(Reading database ... 40337 files and directories currently installed.)
Preparing to unpack linux-image-3.13.0-61-generic_3.13.0-61.100_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Done.
Unpacking linux-image-3.13.0-61-generic (3.13.0-61.100) over (3.13.0-61.100) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
Setting up linux-image-3.13.0-61-generic (3.13.0-61.100) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.13.0-61-generic
vmlinuz(/boot/vmlinuz-3.13.0-61-generic
) points to /boot/vmlinuz-3.13.0-61-generic
 (/boot/vmlinuz-3.13.0-61-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.13.0-61-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-61-generic /boot/vmlinuz-3.13.0-61-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-61-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.13.0-61-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.13.0-61-generic.postinst line 1025.
dpkg: error processing package linux-image-3.13.0-61-generic (--install):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-3.13.0-61-generic
    
por Brian Gradin 06.08.2015 / 02:02

3 respostas

3

Consegui resolver o problema removendo as entradas em /var/lib/dpkg/status que tinham o status de meia-instalação.

    
por Brian Gradin 06.08.2015 / 10:31
2

Execute os seguintes comandos e poste qualquer erro:

EDITAR

sudo apt-get clean
sudo rm /var/cache/apt/archives/partial/*
sudo dpkg --clear-selections
sudo apt-get install --reinstall linux-image-extra-3.13.0-61-generic linux-image-3.13.0-61-generic   

EDIT # 2

Ok, para o erro ( E: /usr/share/initramfs-tools/hooks/fixrtc ), primeiro tente definir esse arquivo como executável e tente novamente a instalação:

sudo chmod -x /usr/share/initramfs-tools/hooks/fixrtc
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall linux-image-extra-3.13.0-61-generic linux-image-3.13.0-61-generic 
    
por mchid 06.08.2015 / 02:24
0

Na página man do apt-get

sob nenhuma circunstância os pacotes atualmente instalados são removidos

Não sei como você pode esconder isso, tho :)

    
por Bacon 06.08.2015 / 02:06