Results 1 to 10 of 20

Thread: perl: warning: Setting locale failed.

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Beans
    1

    perl: warning: Setting locale failed.

    All other threads were closed already, so i started a new one. It may spare some time for you.

    I have a virtual private server running Ubuntu 9.10 and got messages like this:
    Code:
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.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
    To get rid of the messages I had to run this command:

    Code:
    # locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8
    then

    Code:
    # dpkg-reconfigure locales
    The problem was solved. I didn't had to edit any files like /etc/environment
    Hope it helps for you!

    I found the solution here:
    http://www.linuxquestions.org/questi...41#post3540541

  2. #2
    Join Date
    Feb 2010
    Location
    Perth, Western Australia
    Beans
    3
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: perl: warning: Setting locale failed.

    didn't fix the error for me

  3. #3
    Join Date
    Mar 2010
    Beans
    3

    Re: perl: warning: Setting locale failed.

    Worked fine for me, thx.

  4. #4
    Join Date
    May 2008
    Location
    Italy/Switzerland
    Beans
    2
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: perl: warning: Setting locale failed.

    Works for me as well! Thanks.

  5. #5
    Join Date
    Sep 2006
    Location
    Maryland, USA
    Beans
    254
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: perl: warning: Setting locale failed.

    Didn't work for me either
    Impari Systems, Inc
    http://www.imparisystems.com

  6. #6
    Join Date
    Aug 2005
    Location
    Brussels
    Beans
    135
    Distro
    Ubuntu Development Release

    Re: perl: warning: Setting locale failed.

    Quote Originally Posted by matthewboh View Post
    Didn't work for me either
    Worked perfectly for me (Ubuntu 10.04). I just ran:

    sudo locale-gen en_US en_US.UTF-8 cy_GB.UTF-8


    Replaced hungarian (hu) for Welsh (cy).

  7. #7
    Join Date
    Aug 2008
    Beans
    30

    Re: perl: warning: Setting locale failed.

    Worked great! Thank you!!

  8. #8
    Join Date
    Apr 2012
    Beans
    1

    Re: perl: warning: Setting locale failed.

    Thank's you. For russuan
    Code:
    # sudo locale-gen ru_RU ru_RU.UTF-8 ru_RU ru_RU.UTF-8

  9. #9
    Join Date
    Jun 2008
    Beans
    3
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: perl: warning: Setting locale failed.

    This was in the right direction, but unfortunately, didn't fix it for me. What did, however, was this:

    http://bookmarks.honewatson.com/2009...ttings-ubuntu/

    EDIT:

    Further investigation shows the fix in my case was even easier than I thought, before:

    Code:
    $ locale
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    LANG=en_US.UTF-8
    LANGUAGE=en_US:en
    LC_CTYPE=UTF-8
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=
    So I set LC_TYPE and LC_ALL manually like so:

    Code:
    $ export LC_TYPE="en_US.UTF-8"
    $ export LC_ALL="en_US.UTF-8"
    The result is a fix:

    Code:
    $ locale
    LANG=en_US.UTF-8
    LANGUAGE=en_US:en
    LC_CTYPE="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_PAPER="en_US.UTF-8"
    LC_NAME="en_US.UTF-8"
    LC_ADDRESS="en_US.UTF-8"
    LC_TELEPHONE="en_US.UTF-8"
    LC_MEASUREMENT="en_US.UTF-8"
    LC_IDENTIFICATION="en_US.UTF-8"
    LC_ALL=en_US.UTF-8
    SECOND EDIT:

    .. Unfortunately, the above 'solution' only worked for that terminal session. As soon as I reconnected, locale errors rained down on me again..

    Delving furhter into this issue, I came across:
    http://stackoverflow.com/questions/2...ning-from-perl

    What permanently fixed it for me is commenting out the following directive in my /etc/ssh/sshd_config (on the remote host):

    Code:
    AcceptEnv LANG LC_*
    Having eliminated that line, and reloading my ssh daemon, this issue was resolved.
    Last edited by CritiKaster; November 16th, 2013 at 08:32 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •