Skip to content

Error Locale in Raspberry Pi

Aldwin Hermanudin edited this page Feb 12, 2017 · 2 revisions

Error when

Can't set locale; make sure $LC_* and $LANG are correct! perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_TIME = "id_ID.UTF-8", LC_MONETARY = "id_ID.UTF-8", LC_ADDRESS = "id_ID.UTF-8", LC_TELEPHONE = "id_ID.UTF-8", LC_NAME = "id_ID.UTF-8", LC_MEASUREMENT = "id_ID.UTF-8", LC_IDENTIFICATION = "id_ID.UTF-8", LC_NUMERIC = "id_ID.UTF-8", LC_PAPER = "id_ID.UTF-8", LANG = "en_GB.UTF-8" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_GB.UTF-8"). locale: Cannot set LC_ALL to default locale: No such file or directory

There are 2 possible problem, caused by the Raspberry Pi itself or the SSH Client that connects to it.

The solution if (you think) it caused by the rpi. Set locale by :

export LC_ALL=en_GB
export LANGUAGE=en_GB

or putting this directly into /etc/environment

LANGUAGE = en_GB
LC_ALL = en_GB
LANG = en_GB
LC_TYPE = en_GB

or trying:

apt-get install locales-all

or

dpkg-reconfigure locales

solution if (you think) caused by the SSH Client

Does this problem happen if you are using a particular program on the RPi, or is it when you use SSH from >another computer?

If it happens when using SSH, this is a fault on the SSH client, not the RPi. For example using an Ubuntu >machine as the SSH client will cause this problem.

To fix this SSH problem, edit the file /etc/ssh/ssh_config on the SSH client (not the RPi) and remove the line SendEnv LANG LC_*

This stops the client sending invalid locale information to the RPi.