How to fix locale settings in debian lenny (minimal)

debian-lennylocalization

I have a debian machine running remotely, i tried many ways to fix this locale issue, which is harmless while using apt-get though but because of it my web apps are not functioning properly. I have quick googled for the solution and found that dpkg-reconfigure locales will fix the issues but I am still not getting it right.

idlecool@machine:~$ sudo dpkg-reconfigure locales
[sudo] password for idlecool: 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_IN"
    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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
Generation complete.
idlecool@machine:~$ 

Best Answer

You can also try running sudo locale-gen to run localedef for the locales configured in /etc/locales.gen.

If this doesn't help, please post the /etc/locale.gen because than it would seem that he would try to set a locale not generated before.