Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
->bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
When I do
>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_US
LANGUAGE=en_US
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=en_US.UTF-8
I changed the contents of /etc/default/locale to the following
# File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=en_US.UTF-8
I tried to reconfigure locale using
sudo dpkg-reconfigure locales
But every time the menu opens, with no selection made. I have to select
en_US.UTF-8 UTF-8
every time.And selecting this throws the error
Generating locales (this might take a while)...
Generation complete.
*** update-locale: Error: invalid locale settings: LANG=en_GB.UTF-8 LANGUAGE="en_US.UTF-8" LC_ALL="en_US.UTF-8"
How do I remove these warnings?
–
This blog post helped me:
Raspberry Pi -- Fixing your Locale
http://www.jaredwolff.com/blog/raspberry-pi-setting-your-locale
Edit /etc/locale.gen
and uncomment the line with en_US.UTF-8
e.g. sudo nano /etc/locale.gen
uncomment line by deleting leading #
Run sudo locale-gen en_US.UTF-8
Run sudo update-locale en_US.UTF-8
The other answers weren't working for me but I found one that did.
Run sudo nano /etc/default/locale
Change it to include these three lines:
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE=en_US.UTF-8
Then reboot the system and it should be updated.
Since you flashed a new image and it continues to not work, it sounds like you might have a hardware issue. Do you have another raspberry pi to try it on? If you do and you get the same error, make sure you are downloading the right image or try noobs to make sure. If you do not have another raspberry pi, I recommend running sudo update-locale en_US.UTF-8
and seeing if that fixes the issue.
sudo locale-gen en_GB.UTF-8 UTF-8
sudo update-locale en_GB.UTF-8 UTF-8
export LANGUAGE=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8
Verify it;
locale
You may get:
LANG=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=en_GB.UTF-8
And Done !!!