• Cannot set LC_CTYPE to default locale: No such file or directory locale


    Hi. I recently re-installed Antergos on my laptop as a result of a desire to rearrange some partitions. The problem that I am having now is that I cannot start Terminal. Because I cannot use Terminal (it doesn’t seem to start up and is probably confused with what language setting to use or something like that) and most likely have the wrong locale setting, I am using Guake Terminal to navigate around not having the regular Terminal in use.

    I imagine that it is the result of not having the correct locale. I know that setting the correct locale is with the local.conf and thereafter the locale-gen command.

    Here is the output of locale -a :
    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_COLLATE to default locale: No such file or directory

    Here is the output of locale:
    [[email protected] ~]$ locale
    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=en_CA.utf8
    LC_CTYPE="en_CA.utf8"
    LC_NUMERIC=en_US.utf8
    LC_TIME=en_US.utf8
    LC_COLLATE="en_CA.utf8"
    LC_MONETARY=en_US.utf8
    LC_MESSAGES="en_CA.utf8"
    LC_PAPER=en_US.utf8
    LC_NAME="en_CA.utf8"
    LC_ADDRESS="en_CA.utf8"
    LC_TELEPHONE="en_CA.utf8"
    LC_MEASUREMENT=en_US.utf8
    LC_IDENTIFICATION="en_CA.utf8"
    LC_ALL=

    As you can see there is both en_CA and en_US. I just want to have en_US.
    Here is the locale.conf file from /etc/locale.conf:
    LANG=en_US.UTF-8

    As explained earlier, I did do a locale-gen with a subsequent reboot. I should also state that glibc is installed.
    I also tried to do a system wide locale change using the following command:
    localectl set-locale LANG=en_US.UTF-8

    There doesn’t seem to be anything unusual inside the local.sh file in the profile.d folder. Here is what that file looks like and is quite normal:
    #!/bin/sh

    if [ -z “$LANG” ]; then
    if [ -n “$XDG_CONFIG_HOME” ] && [ -r “$XDG_CONFIG_HOME/locale.conf” ]; then
    . "$XDG_CONFIG_HOME/locale.conf"
    elif [ -n “$HOME” ] && [ -r “$HOME/.config/locale.conf” ]; then
    . "$HOME/.config/locale.conf"
    elif [ -r /etc/locale.conf ]; then
    . /etc/locale.conf
    fi
    fi

    LANG=${LANG:-C}
    export LANG
    [ -n “$LC_CTYPE” ] && export LC_CTYPE
    [ -n “$LC_NUMERIC” ] && export LC_NUMERIC
    [ -n “$LC_TIME” ] && export LC_TIME
    [ -n “$LC_COLLATE” ] && export LC_COLLATE
    [ -n “$LC_MONETARY” ] && export LC_MONETARY
    [ -n “$LC_MESSAGES” ] && export LC_MESSAGES
    [ -n “$LC_PAPER” ] && export LC_PAPER
    [ -n “$LC_NAME” ] && export LC_NAME
    [ -n “$LC_ADDRESS” ] && export LC_ADDRESS
    [ -n “$LC_TELEPHONE” ] && export LC_TELEPHONE
    [ -n “$LC_MEASUREMENT” ] && export LC_MEASUREMENT
    [ -n “$LC_IDENTIFICATION” ] && export LC_IDENTIFICATION

    I think that earlier I also tried to do an export using:
    export LANG=“en_US.UTF-8”

    Of course, as explained earlier, I did do a locale-gen

    [[email protected] ~]$ sudo locale-gen
    Generating locales…
    en_US.UTF-8… done
    Generation complete
    There was no effect. Not too sure what the problem continues to be. One funny thing, after doing the locale-gen command, the file locale.gen in /etc directory is the following (only a small section is pasted):

    #en_SG ISO-8859-1
    en_US.UTF-8 UTF-8
    #en_US ISO-8859-1

    I used the information from the Arch Wiki:
    https://wiki.archlinux.org/index.php/Locale#LC_COLLATE:_collation

    Download " antergos-wallpapers-extra " and enjoy community sponsored wallpapers.

    Use the "Linux Beginner Search Engine"

    https://cse.google.com/cse/home?cx=017607476515012185699:b_owgx6xyi0

  • Hi,

    Which desktop are you using? You need to ensure the correct locale and keyboard layout is selected in the system settings app for your DE. Let me know if that helps.

    Cheers!

  • Hi lots.0.logs.
    In order to reduce the frustration that I have had for the better part of the day in trying to resolve this issue via Google and the Arch Wiki and the fact that it was a fairly newer install, I just re-installed.
    FYI, I was (and continue as such) using the Gnome desktop.
    When I now do locale and locale -a I get the following result. However, that is only because I used the US keyboard and US language settings upon initial set up/install.
    I don’t get the prior errors that I had when it was kind of a mixed bag of English keyboard setup and English language setup.

    [[email protected] ~]$ locale
    LANG=en_US.UTF-8
    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=
    [[email protected] ~]$ locale -a
    C
    en_US.utf8
    POSIX

    Out of curiosity, what would or could I have done to resolve this issue. Am asking for the sake of knowledge.
    Could there be a bug in Cnchi set up during install when using the English version of en_CA.utf8 and en_US.utf8?
    By the way, having formerly gone to Regions and Language in the Settings menu, I had Lang=English and Format as Canadian. Shouldn’t have made a difference but somehow it did. I am mentioning this specifically because when I had the en_CA.utf8 I was not able to utilize the ‘at’ symbol (@) when Shift+2 used. Now that I have en_US.utf8, I now can properly use the ‘at’ symbol. Further, upon initially setting up the password, I used the ‘at’ @ symbol within that password. Somehow instead of the @ symbol present, what I had was the " (quotes) instead.
    Bug?

    Download " antergos-wallpapers-extra " and enjoy community sponsored wallpapers.

    Use the "Linux Beginner Search Engine"

    https://cse.google.com/cse/home?cx=017607476515012185699:b_owgx6xyi0

  • To be honest, I really have no idea. I know very little about system locales. My theory was that your settings in GNOME system settings for keyboard and locale were not correct and were overriding what you tried to do using the localectl command.

Posts 4Views 3950
Log in to reply