Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

14 August 2008

locale: Cannot set LC_CTYPE to default locale

I get this problem a lot.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_AU.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

I think possibly this solves it.

$ sudo apt-get install --reinstall language-pack-en

It says comforting things like...

Generating locales...
  en_AU.UTF-8... done
  en_BW.UTF-8... done

Update: Except it didn't work. But maybe this will.

$ sudo localedef -i en_AU -f UTF8 en_AU.utf8

Comments

  1. Hi,
    I solved this problem like this:

    apt-get install locales

    and then

    dpkg-reconfigure locales

    in the dialog window I selected US_en.UTF8 (or something similar) and no problems now.

    hrasko / 11:22pm / 18 September 2008

  2. Thanks!

    This has solved an extremely annoying problem that was REALLY getting on my nerves.

    Thanks again, and bookmarked for future reference.

    Scott / 11:44pm / 11 November 2008

  3. Solved! Thanks my friend; I’m now free from annoying bugs whenever I apt-get anything!

    Jon Chase / 3:43am / 22 November 2008

  4. this worked perfectly! thanks.

    jayesh / 12:45am / 12 June 2009

  5. This works. The only bad thing, this changes date settings or labguage.
    If you want correct date settings you get wrong language or vice versa.
    There need to be correct solution.

    J / 7:41am / 6 December 2010

  6. Adding a dash like:

    sudo localedef -i en_US -f UTF-8 en_US.utf8

    worked for me!

    Ken / 7:14am / 19 January 2011

  7. My underscore just started/stopped italics. The main difference is UTF-8 in place of UTF8. Trying inside quotes:

    “sudo localedef -i en_US -f UTF-8 en_US.utf8”

    Ken / 7:20am / 19 January 2011

  8. […] 看着够烦人的,网上搜了一下罗列了不少解决办法,要么太麻烦,要么根本没用,走了不少弯路。下面说说我的解决办法(其实也是google来的:http://fatvegan.com/2008/08/14/cannot-set-lc_ctype/) […]

    Leng Chuan Yu's Blog » Blog Archive » perl: warning: Setting locale failed.的报错解决 / 2:37pm / 11 February 2011

  9. hi,

    I tried what you suggested but I got this:
    warning: setlocale: LC_ALL: cannot change locale (en_US)

    Aly Badawy / 8:57am / 13 August 2011

  10. Mmm. Sorry folks. Markdown not so great for everything.

    Ryan / 5:20pm / 13 August 2011

  11. If you are using ssh to connect to server.. maybe from your macbook like me? Then set the env var on the client your connecting from.

    Joey / 12:56am / 27 December 2011

Leave a comment

Markdown

0.089 seconds