Could not find postinst hook script [update-grub] 错误

在执行apt-get和系统更新时都遇到了一个错误:

update-initramfs: Generating /boot/initrd.img-2.6.32-41-generic
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.32-41.88 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(2.6.32-41.88 was configured last, according to dpkg)
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg:处理 linux-image-2.6.32-41-generic (--configure)时出错:
 子进程 已安装的 post-installation 脚本 返回了错误号 2
在处理时有错误发生:
 linux-image-2.6.32-41-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

这个错误信息的源头就是这段信息上面所显示的一个错误:Could not find postinst hook script [update-grub]
原因是/etc/kernal-img.conf里面的postinst_hook无法找到后面那个值所指向的目录,比如在我的系统上面就是因为我之前误删了grub,而后面配置了update-grub,因此出错了。。

所以我就直接apt-get install grub解决了

你可能感兴趣的:(image,脚本,hook)