-1

for example when I "sudo apt-get install libmemcache0", I got:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libmemcache0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up linux-image-2.6.24-16-xen (2.6.24-16.30) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.24-16-xen
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg: error processing linux-image-2.6.24-16-xen (--configure):
 subprocess post-installation script returned error exit status 2
Setting up linux-image-2.6.24-24-386 (2.6.24-24.61) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "zh_CN.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.24-24-386
Could not find postinst hook script [update-grub].
Looked in: '/bin', '/sbin', '/usr/bin', '/usr/sbin'
dpkg: error processing linux-image-2.6.24-24-386 (--configure):
 subprocess post-installation script returned error exit status 2
Errors were encountered while processing:
 linux-image-2.6.24-16-xen
 linux-image-2.6.24-24-386
E: Sub-process /usr/bin/dpkg returned an error code (1)

What can I do?

I am using linode and no grub.

Tinyfool
  • 153
  • 1
  • 7
  • http://ubuntuforums.org/showthread.php?t=1346581 – quanta Dec 06 '11 at 07:49
  • @quanta Thanks, I use your tip fix the locales error, but main error still there. – Tinyfool Dec 06 '11 at 07:57
  • Seems like you cross-posted your question on several sites. If your problem is solved, can you clear the situation so we don't spend time to solve this on other sites ? Thanks. http://superuser.com/questions/365087/when-i-apt-get-anything-i-got-this-erroe-sub-process-usr-bin-dpkg-returned-an http://webmasters.stackexchange.com/questions/22990/when-i-apt-get-anything-i-got-this-erroe-sub-process-usr-bin-dpkg-returned-an – Maxime R. Dec 06 '11 at 09:25

1 Answers1

2

As a temporary fix to make apt happy you could probably adjust your kernel-img.conf file so that the system does not try to run update-grub. This should permit the post install scripts to finish without errors. It will obviously not update the boot loader or switch your system to use the newer kernel. Since you are using a kernel specific to xen, you almost certainly don't want to switch over to a standard 386 kernel.

#/etc/kernel-img.conf
# Kernel image management overrides
# See kernel-img.conf(5) for details
do_symlinks = yes
relative_links = yes
do_bootloader = no
do_bootfloppy = no
do_initrd = yes
link_in_boot = no
#postinst_hook = update-grub
#postrm_hook   = update-grub
Zoredache
  • 128,755
  • 40
  • 271
  • 413