Debian apt-get upgrade fails for package linux-image-2.6.18-5-686

Was working on a Linux server today in the datacenter that we use for monitoring our Cisco gear and decided to upgrade all the Debian packages. I came across the following error and was able to resolve the issue.

Searching for GRUB installation directory … found: /boot/grub
Searching for default file … found: /boot/grub/default
Testing for an existing GRUB menu.lst file … found: /boot/grub/menu.lst
Searching for splash image … none found, skipping …
Found kernel: /vmlinuz-2.6.20.1.intel
Found kernel: /vmlinuz-2.6.18-5-686
Updating /boot/grub/menu.lst … /usr/sbin/update-grub: line 1154: /boot/grub/menu.lst: Permission denied
User postinst hook script [/sbin/update-grub] exited with value 1
dpkg: error processing linux-image-2.6.18-5-686 (–configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-2.6.18-5-686
E: Sub-process /usr/bin/dpkg returned an error code (1)

Sponsors, article continues below...

I actually found the solution on an Hungarian Linux forum http://hup.hu/node/48864. It turns out that /boot/grub/menu.1st has an immutable attribute on the file that you need to remove before upgrading the kernel package. You can do this by simply issuing an “chattr -i /boot/grub/menu.1st”.

This entry was posted in Linux.

Leave a Reply