我正在用这个内核版本运行Debian unstable的VPS:
2.6.32-274.7.1.el5.028stab095.1
我刚刚升级了我的软件包,出于某种奇怪的原因,APT希望我安装linux-image-3.2.0-3-amd64 ,这很奇怪,因为我无法修改内核,因为它是VPS。 无论如何,我尝试安装它,但正如我怀疑它没有工作:
root@youmu:~# apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? Y Setting up linux-image-3.2.0-3-amd64 (3.2.23-1) ... Running depmod. vmlinuz(/boot/vmlinuz-3.2.0-3-amd64 ) points to /boot/vmlinuz-3.2.0-3-amd64 (/boot/vmlinuz-3.2.0-3-amd64) -- doing nothing at /var/lib/dpkg/info/linux-image-3.2.0-3-amd64.postinst line 268. initrd.img(/boot/initrd.img-3.2.0-3-amd64 ) points to /boot/initrd.img-3.2.0-3-amd64 (/boot/initrd.img-3.2.0-3-amd64) -- doing nothing at /var/lib/dpkg/info/linux-image-3.2.0-3-amd64.postinst line 268. Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-3-amd64 /boot/vmlinuz-3.2.0-3-amd64 update-initramfs: Generating /boot/initrd.img-3.2.0-3-amd64 run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-3-amd64 /boot/vmlinuz-3.2.0-3-amd64 Searching for GRUB installation directory ... found: /boot/grub Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0 entry not specified. run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1 Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-3-amd64.postinst line 696. dpkg: error processing linux-image-3.2.0-3-amd64 (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: linux-image-3.2.0-3-amd64 E: Sub-process /usr/bin/dpkg returned an error code (1) root@youmu:~#
所以我试图删除它,但它仍然失败。
我想知道是否有办法让APT忽略一个软件包,就好像它不存在一样,所以每次我安装一个软件包时都不会出错。 我试图把这个软件包搁置,但它仍然想重新configuration它。
有什么build议么?
postinst文件结尾:
## Run user hook script here, if any if ($postinst_hook) { &run_hook("postinst", $postinst_hook); } if (-d "/etc/kernel/postinst.d") { print STDERR "Examining /etc/kernel/postinst.d.\n"; system ("run-parts --verbose --exit-on-error --arg=$version " . "--arg=$realimageloc$kimage-$version " . "/etc/kernel/postinst.d") && die "Failed to process /etc/kernel/postinst.d"; } if (-d "/etc/kernel/postinst.d/$version") { print STDERR "Examining /etc/kernel/postinst.d/$version.\n"; system ("run-parts --verbose --exit-on-error --arg=$version " . "--arg=$realimageloc$kimage-$version " . "/etc/kernel/postinst.d/$version") && die "Failed to process /etc/kernel/postinst.d/$version"; } exit 0; __END__
作为临时文件,通过运行以下/etc/kernel/postinst.d/zz-update-grub来/etc/kernel/postinst.d/zz-update-grub的exec update-grub :
$ sudo sed -i.bak '/exec update-grub/s/^/#/' /etc/kernel/postinst.d/zz-update-grub
然后运行configuration脚本:
$ sudo dpkg --configure -a
如果有效,可以将zz-update-grub文件恢复到原来的内容。