按照从 Wheezy 迁移到 Jessie 的说明,我更新了我的源apt-get update;apt-get upgrade;apt-get dist-upgrade
(不是一次更新,但足以检查一切正常),并重新启动了我的 VPS。
我开始着手从 php5 切换到 php7,删除 php 包,突然我发现这种情况开始发生,通过每个 apt:
The following packages will be REMOVED:
linux-image-2.6.32-5-amd64
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 104 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 33495 files and directories currently installed.)
Removing linux-image-2.6.32-5-amd64 (2.6.32-48squeeze6) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
update-initramfs: Deleting /boot/initrd.img-2.6.32-5-amd64
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Searching for GRUB installation directory ... found: /boot/grub
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-2.6.32-5-amd64.postrm line 234, <STDIN> line 2.
dpkg: error processing package linux-image-2.6.32-5-amd64 (--remove):
subprocess installed post-removal script returned error exit status 2
Errors were encountered while processing:
linux-image-2.6.32-5-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试着按住它,希望 apt 会忽略它,因为我似乎对此无能为力,但我得到了
E: Can't find a source to download version '2.6.32-48squeeze6' of 'linux-image-2.6.32-5-amd64:amd64'
据我所知,有问题的软件包尚未安装。
答案1
dpkg --purge --force-remove-reinstreq linux-image-2.6.32-5-amd64
这将从系统中清除该包。问题已解决。