it-roy-ru.com

Как очистить список удаления apt-get?

apt-get upgrade показывает, что пакет должен быть удален:

[email protected]:~$ 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.

Этот пакет никогда не удаляется, и я не думаю, что это необходимо. Как я могу получить apt-get, чтобы перестать пытаться удалить его?

Правка:

Вывод 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)

Правка 2:

Скачал 64-битный пакет для linux-image-3.13.0-61-generic и попытался установить его с помощью 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
1
Brian Gradin

Я смог решить эту проблему, удалив записи в /var/lib/dpkg/status, которые были наполовину установлены.

3
Brian Gradin

Запустите следующие команды и, пожалуйста, опубликуйте сообщения об ошибках:


РЕДАКТИРОВАТЬ

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

Хорошо, для ошибки (E: /usr/share/initramfs-tools/hooks/fixrtc), сначала попробуйте установить этот файл как исполняемый и повторите установку:

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 
2
mchid

Со страницы apt-get man

ни при каких обстоятельствах установленные в данный момент пакеты не удаляются

Не знаю, как ты можешь это скрыть, хотя :)

0
Bacon