Page 1 of 1

raspi-config doesn't set locale

Posted: Fri Oct 05, 2012 4:12 pm
by janoble
When I try to set the locale using raspi-config I it doesn't seem to work and messes up my keyboard mapping. Here's what a session looks like:


[email protected] ~ $ more locale.txt
[email protected] ~ $ sudo raspi-config
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or director
y
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or direc
tory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or director
y
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or direc
tory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory

Current default time zone: 'America/Denver'
Local time is now: Fri Oct 5 09:25:57 MDT 2012.
Universal Time is now: Fri Oct 5 15:25:57 UTC 2012.

Re: raspi-config doesn't set locale

Posted: Fri Oct 05, 2012 7:47 pm
by janoble
I've connected using putty from a Win7 computer and the keymapping looks fine. Had no problem connecting using SSH.

Re: raspi-config doesn't set locale

Posted: Fri Oct 12, 2012 12:58 am
by JimDod
I see the same problem. I am using arch linix

Re: raspi-config doesn't set locale

Posted: Fri Oct 12, 2012 11:27 pm
by JimDod
My fix was simple, after if figured it out


I put

export LC_ALL=C

in my .bashrc

Re: raspi-config doesn't set locale

Posted: Sat Oct 13, 2012 2:19 am
by janoble
Why thanks. That does sound simple. I'll try it tomorrow morning and let you know if it works to fix my keyboard mapping problem. How did you figure this one out?

Thanks
Joe

Re: raspi-config doesn't set locale

Posted: Sat Oct 13, 2012 5:01 am
by Dweeber
The locale is normally set in the system for system wide use in

/etc/default/locale

Code: Select all

#  File generated by update-locale
LANG=en_US.UTF-8
You can also manually set the keyboard via the file

/etc/default/keyboard

Code: Select all

# Check /usr/share/doc/keyboard-configuration/README.Debian for
# documentation on what to do after having modified this file.

# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

# If you don't want to use the XKB layout on the console, you can
# specify an alternative keymap.  Make sure it will be accessible
# before /usr is mounted.
# KMAP=/etc/console-setup/defkeymap.kmap.gz

Re: raspi-config doesn't set locale

Posted: Sat Oct 13, 2012 1:25 pm
by janoble
I tried the "export LC_ALL=C" in my .bashrc and it seems to work. The keyboard mapping seems to make sense now. Here's what I get from the locale command:
  • LANG=en_US.UTF-8
    LANGUAGE=
    LC_CTYPE="C"
    LC_NUMERIC="C"
    LC_TIME="C"
    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=C
I also looked in the two etc/default files and they look reasonable.

/etc/default/locale:
  • # File generated by update-locale
    LANG=en_US.UTF-8
/etc/default/keyboard
  • # KEYBOARD CONFIGURATION FILE

    # Consult the keyboard(5) manual page.

    XKBMODEL="logitech_base"
    XKBLAYOUT="us"
    XKBVARIANT=""
    XKBOPTIONS="lv3:ralt_alt"

    BACKSPACE="guess"
I'm a little surprised that LANGUAGE doesn't appear to be set, but heh, it seems to be working for now.

Everything seems to be working, so I'm now a happy camper! :D

Thanks for the post responses and the help they provided.

Joe

Re: raspi-config doesn't set locale

Posted: Sun May 26, 2013 6:03 am
by sander2
JimDod wrote:My fix was simple, after if figured it out


I put

export LC_ALL=C

in my .bashrc
That worked for me. Thank you!

Re: raspi-config doesn't set locale

Posted: Sat Mar 01, 2014 4:16 pm
by daved
I just found that if you don't set your locale properly in raspi-config (or original setup), you get those warnings. After you set your locale, it then asks for your Default Locale and gives you two options: None (selected by default), or the option you selected above. You need to select your option, then you won't get those warnings.

Cheers

Re: raspi-config doesn't set locale

Posted: Wed Apr 15, 2015 3:13 am
by Jaroden [RasuOsu]
daved wrote:I just found that if you don't set your locale properly in raspi-config (or original setup), you get those warnings. After you set your locale, it then asks for your Default Locale and gives you two options: None (selected by default), or the option you selected above. You need to select your option, then you won't get those warnings.

Cheers
ok how do you select the said option? because even if i select the none it still says the same thing on the bottom of the screen.
when you highlight either of the options then hit ok. It gives the same result.
Generating locals (this might take a while)...
en_US.UTF-8
Generation complete

How do i select the right option?

Re: raspi-config doesn't set locale

Posted: Thu Aug 13, 2015 10:14 am
by Nerol
I solved that with this:

Code: Select all

sudo dpkg-reconfigure locales
And following the process

Re: raspi-config doesn't set locale

Posted: Thu Aug 13, 2015 1:16 pm
by klricks
Jaroden [RasuOsu] wrote:
daved wrote:I just found that if you don't set your locale properly in raspi-config (or original setup), you get those warnings. After you set your locale, it then asks for your Default Locale and gives you two options: None (selected by default), or the option you selected above. You need to select your option, then you won't get those warnings.

Cheers
ok how do you select the said option? because even if i select the none it still says the same thing on the bottom of the screen.
when you highlight either of the options then hit ok. It gives the same result.
Generating locals (this might take a while)...
en_US.UTF-8
Generation complete

How do i select the right option?
In the long list of locales use space bar to select/un-select. Be sure to browse the entire list and un-select any unwanted locales. In the next menu you will see all of the locales that you selected in the first step. (Most should have only selected one locale). Use the arrow keys to move down the llst and highlight the one locale that you want then arrow to [OK] (Do not select NONE else you will get none).

Re: raspi-config doesn't set locale

Posted: Fri Oct 21, 2016 9:35 am
by barraba
interesting, my ssh is in propper language and console is abra-cadabra.
Used raspi-config for configuration. :-(

Re: raspi-config doesn't set locale

Posted: Sun Oct 01, 2017 7:57 am
by jtarrico
I was having this same issue today. Try adding the following


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