Fixing the error message “perl: warning: Setting locale failed” on Debian

Full error message:

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
Package `locales' is not installed and no info is available.

First install the package as suggested:

apt-get install locales

Then, reconfigure and generate locales:

dpkg-reconfigure locales

A menu will popup where you can select to generate all locales, and set default locale. I set en_GB as default


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.