Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im running an ubuntu server version 10.04 LTS. I did a "sudo apt-get upgrade" on my server today and it failed with the following:

Setting up linux-image-2.6.32-318-ec2 (2.6.32-318.38) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-318-ec2
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg: error processing linux-image-2.6.32-318-ec2 (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-2.6.32-319-ec2 (2.6.32-319.39) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-319-ec2
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg: error processing linux-image-2.6.32-319-ec2 (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-2.6.32-34-server (2.6.32-34.77) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-34-server
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg: error processing linux-image-2.6.32-34-server (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-ec2:
 linux-image-ec2 depends on linux-image-2.6.32-319-ec2; however:
  Package linux-image-2.6.32-319-ec2 is not configured yet.
dpkg: error processing linux-image-ec2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-ec2:
 linux-ec2 depends on linux-image-ec2 (= 2.6.32.319.20); however:
  Package linux-image-ec2 is not configured yet.
dpkg: error processing linux-ec2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-server:
 linux-image-server depends on linux-image-2.6.32-34-server; however:
  Package linux-image-2.6.32-34-server is not configured yet.
dpkg: error processing linux-image-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                                                                                                            No apport report written because MaxReports is reached already
                                                                                                                                                                                          No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-server:
 linux-server depends on linux-image-server (= 2.6.32.34.40); however:
  Package linux-image-server is not configured yet.
dpkg: error processing linux-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-2.6.32-318-ec2
 linux-image-2.6.32-319-ec2
 linux-image-2.6.32-34-server
 linux-image-ec2
 linux-ec2
 linux-image-server
 linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any idea how to fix this?

share|improve this question

migrated from stackoverflow.com Nov 8 '11 at 8:07

This question came from our site for professional and enthusiast programmers.

1  
This question doesn't seem appropriate for SO, perhaps ServerFault would be a better venue? (This seems to be a question about administering an Ubuntu system rather than about programming). –  Jim Dennis Nov 7 '11 at 11:10
    
sorry I wasent aware that there was a "forum" other than stackoverflow for server management :) –  Ronnie Jespersen Nov 8 '11 at 8:45
    
Please edit your post to show the output of uname -m and/or lscpu, so we know what hardware you're running on. That will determine which boot loader you should have installed. –  Andrew Schulman Nov 8 '11 at 9:02

1 Answer 1

up vote 0 down vote accepted

The key error is this:

update-initramfs: Generating /boot/initrd.img-2.6.32-318-ec2
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'

All the other errors follow from that one.

It seems that dpkg wants to run update-grub, but it's not available on your host. On my host, I have

$ which update-grub
/usr/sbin/update-grub
$ dpkg --search /usr/sbin/update-grub
grub-pc: /usr/sbin/update-grub
$ apt-cache policy grub-pc
grub-pc:
  Installed: 1.98+20100804-5ubuntu3.3
  Candidate: 1.98+20100804-5ubuntu3.3
  Version table:
 *** 1.98+20100804-5ubuntu3.3 0
        500 http://us.archive.ubuntu.com/ubuntu/ maverick-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.98+20100804-5ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages

Depending on your hardware, you might have a different one of the grub-* packages installed:

$ apt-file -x search '/usr/sbin/update-grub$'
grub: /usr/sbin/update-grub
grub-coreboot: /usr/sbin/update-grub
grub-efi-amd64: /usr/sbin/update-grub
grub-efi-ia32: /usr/sbin/update-grub
grub-ieee1275: /usr/sbin/update-grub
grub-pc: /usr/sbin/update-grub

You almost certainly have one of the above packages installed. Use dpkg --search /usr/sbin/update-grub to find out which one it is, then apt-get --reinstall install to reinstall it.

share|improve this answer
    
Okay... its running on a virtualized enviroment Xen server... im not sure grup-pc is installed on any of our servers... rj@web1:~$ apt-cache policy grub-pc grub-pc: Installed: (none) Candidate: 1.98-1ubuntu12 Version table: 1.98-1ubuntu12 0 500 dk.archive.ubuntu.com/ubuntu lucid-updates/main Packages 1.98-1ubuntu7 0 100 /var/lib/dpkg/status 1.98-1ubuntu5 0 500 dk.archive.ubuntu.com/ubuntu lucid/main Packages –  Ronnie Jespersen Nov 8 '11 at 8:38
    
Edited. You may have a different grub-* package installed, depending on your hardware platform. –  Andrew Schulman Nov 8 '11 at 9:23
    
Ah thanks Andrew... I noticed I had removed grub-pc from this server for some reason... installing it again worked :) –  Ronnie Jespersen Nov 8 '11 at 10:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.