Find the answer to your Linux question:
Results 1 to 6 of 6

Thread: Locale Problem?

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Aug 2005
    Location
    Sterling, VA
    Posts
    100

    Locale Problem?


    When I use apt to install anything, I get errors such as this:
    Code:
    sumo:/etc/init.d# apt-get install most
    Reading Package Lists... Done
    Building Dependency Tree... Done
    The following NEW packages will be installed:
      most
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 42.2kB of archives.
    After unpacking 147kB of additional disk space will be used.
    Get:1 http://mirrors.kernel.org stable/main most 4.9.5-1 [42.2kB]
    Fetched 42.2kB in 1s (36.7kB/s)
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = "en_US:en_GB:en",
            LC_ALL = (unset),
            LANG = "en"
        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
    Selecting previously deselected package most.
    (Reading database ... 21108 files and directories currently installed.)
    Unpacking most (from .../archives/most_4.9.5-1_i386.deb) ...
    Setting up most (4.9.5-1) ...
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = "en_US:en_GB:en",
            LC_ALL = (unset),
            LANG = "en"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    Anybody know what might be wrong here? Looks like there is some setting somewhere I need to set.
    - EndianX -

  2. #2
    Linux Newbie
    Join Date
    Aug 2005
    Location
    Sterling, VA
    Posts
    100
    Just got this when running man.
    Code:
    can't set the locale; make sure $LC_* and $LANG are correct
    Something is definitly very wrong and it seems to be important.
    - EndianX -

  3. #3
    (i think) you can check LANG like so (as root):
    Code:
    set |grep LANG
    LANG=en_US.UTF-8
    Now what? You have Linux installed and running. The GUI is working fine, but you are getting tired of changing your desktop themes. You keep seeing this "terminal" thing. Don't worry, they'll show you what to do @
    <~ http://www.linuxcommand.org/ ~>

  4. $spacer_open
    $spacer_close
  5. #4
    I had the same problem. I fixed it by deleting the lines in
    /etc/locale.gen
    and removing the package locales and re-installing it
    Code:
    apt-get remove locales
    apt-get install locales
    Upon re-installing you will be asked which locales to generate. I ran into some other issues because I installed the package localepurge. Remove this if you have it, it will mess up the initial locale gen.
    If you have other problems try
    Code:
    dpkg-reconfigure locales

  6. #5
    in my case removing the locales didn't work. dependencies and so on ...
    finally i somehow ended up editing

    /etc/environment :
    LANGUAGE="en_US:en_GB"
    LANG="C"
    LC_TIME="de_AT.utf8"

    which leads to the following :

    running "locale" as normal user
    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
    LANG=de_CH@euro
    LANGUAGE=en_AT:en_US:en_GB:en
    LC_CTYPE="de_CH@euro"
    LC_NUMERIC="de_CH@euro"
    LC_TIME="de_CH@euro"
    LC_COLLATE="de_CH@euro"
    LC_MONETARY="de_CH@euro"
    LC_MESSAGES="de_CH@euro"
    LC_PAPER="de_CH@euro"
    LC_NAME="de_CH@euro"
    LC_ADDRESS="de_CH@euro"
    LC_TELEPHONE="de_CH@euro"
    LC_MEASUREMENT="de_CH@euro"
    LC_IDENTIFICATION="de_CH@euro"
    LC_ALL=


    as root :
    LANG=C
    LANGUAGE=en_AT:en_US:en_GB:en
    LC_CTYPE="C"
    LC_NUMERIC="C"
    LC_TIME=de_AT.utf8
    LC_COLLATE="C"
    LC_MONETARY="C"
    LC_MESSAGES="C"
    LC_PAPER="C"
    LC_NAME="C"
    LC_ADDRESS="C"
    LC_TELEPHONE="C"
    LC_MEASUREMENT="C"
    LC_IDENTIFICATION="C"
    LC_ALL=

    the thing is, changing the files ~/.xsession and ~/.bashrc
    with things like
    LANG="de_AT.utf8"
    export LANG

    doesn't really affect things. somehow everything just behaves strange ...
    and de_CH@euro doesn't exist in the /usr/share/i18n/SUPPORTED file. no idea how i got this. but i'd like to get rid of it

  7. #6

    Locale fix

    To close off this issue and for future problems:

    Code:
    sudo localedef -i lang-f /path/to/charmap lang
    where lang is your language (en_US)
    and charmap is UTF-8,
    just run locate UTF-8 to find the path.

Posting Permissions

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