Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I try to update my Ubuntu 12.04 and I have this error, then it update kernel. Any clue what I can do to fix this?

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-3.2.0-25-generic (3.2.0-25.40) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-25-generic
Warning: No support for locale: en_US.utf8
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
Generating grub.cfg ...
/etc/grub.d/10_linux: 24: .: Can't open /usr/share/grub/grub-mkconfig_lib
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-25-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-25-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.2.0-25-generic; however:
  Package linux-image-3.2.0-25-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 3.2.0.25.27); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up plymouth-theme-kubuntu-logo (1:12.04ubuntu4) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                               update-initramfs: deferring update (trigger activated)
Generating grub.cfg ...
/etc/grub.d/10_linux: 24: .: Can't open /usr/share/grub/grub-mkconfig_lib
dpkg: error processing plymouth-theme-kubuntu-logo (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-25-generic
Warning: No support for locale: en_US.utf8
Errors were encountered while processing:
 linux-image-3.2.0-25-generic
 linux-image-generic
 linux-generic
 plymouth-theme-kubuntu-logo
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
Does the file /usr/share/grub/grub-mkconfig_lib exist? Is it readable? – Samik Jun 25 '12 at 13:01
No, file didn't exists – ShockwaveNN Jun 25 '12 at 13:34
1  
So that's the problem, if you believe that you've not accidentally delete that file then please make a bug report. – Samik Jun 25 '12 at 14:16
Is there any way to fix this error? I can't make a bug report, because I have no idea when this error started, bug report will be very misleading – ShockwaveNN Jun 26 '12 at 6:25

1 Answer

up vote 1 down vote accepted

I've pasted the content of /usr/share/grub/grub-mkconfig_lib here. You can download it and place it in appropriate place, then retry.

Also, look for the file /usr/lib/grub/grub-mkconfig_lib. Generally, it's a symbolic link to /usr/share/grub/grub-mkconfig_lib. But do check if the original file is there. If in your case /usr/lib/grub/grub-mkconfig_lib is the original file then open the file /etc/grub.d/10_linux and change its 22nd line from datarootdir="${prefix}/share" to datarootdir="${prefix}/lib" then complete the upgrade.

share|improve this answer
1  
Thanks, your solution works. And I found already existed bug on launchpad bugs.launchpad.net/linuxmint/+bug/1006772 – ShockwaveNN Jun 26 '12 at 12:45

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.