How to fix a locale setting warning from Perl?

后端 未结 30 1390
清酒与你
清酒与你 2020-11-27 08:36

When I run perl, I get the warning:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset         


        
相关标签:
30条回答
  • 2020-11-27 09:34

    With zsh ohmyzsh I added this to the .zshrc:

     # You may need to manually set your language environment
     LANGUAGE=en_US.UTF-8
     LANG=en_US.UTF-8
     LC_CTYPE=en_US.UTF-8
     LC_ALL=en_US.UTF-8
    

    By removing the line export LANG=en_US.UTF-8

    Reopened a new tab and SSHed in, worked for me :)

    0 讨论(0)
  • 2020-11-27 09:35

    on Debian after much searching this did the trick.

    first:

    sudo apt-get purge locales
    

    then:

    sudo aptitude install locales
    

    and the famous:

    sudo dpkg-reconfigure locales
    

    This rids the system of locales, then re-installs locales and downgrades libc6 from 2.19 to 2.13 which is the issue. Then configures locales again.

    0 讨论(0)
  • 2020-11-27 09:36

    All the previous answers are wrong. The message is clear - missing locale. The solution is to add the appropriate locale. You do that by editing the /etc/locale.gen file, remove the # sign in front of the locale being reported as missing and then issuing the command:

    $ sudo locale-gen
    

    This will actually generate the locales specified in /etc/locale.gen and therefore the message will not be shown.

    0 讨论(0)
  • 2020-11-27 09:37

    For Ubuntu use this,

    #export LANGUAGE=en_US.UTF-8
    #export LC_ALL=en_US.UTF-8
    #export LANG=en_US.UTF-8
    #export LC_TYPE=en_US.UTF-8
    

    Worked for me.

    0 讨论(0)
  • 2020-11-27 09:37
    perl: warning: Falling back to the standard locale ("C").
    locale: Cannot set LC_ALL to default locale: No such file or directory
    

    Solution:

    Try this (uk_UA.UTF-8 is my current locale. Write your locale, for example en_US.UTF-8 !)

    sudo locale-gen uk_UA.UTF-8
    

    and this.

    sudo dpkg-reconfigure locales
    
    0 讨论(0)
  • 2020-11-27 09:37

    Add LC_ALL="en_GB.utf8" to /etc/environment and reboot. That's all.

    0 讨论(0)
提交回复
热议问题