error messages below keep popping up every time I login to my raspberry pi.
-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)
andpi@raspberrypi:~ $ 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
C
C.UTF-8
POSIX
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US.UTF-8",
LC_CTYPE = "UTF-8",
LANG = "en_US.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 directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
And there are bunch of locale warning during my apt-get install which is really annoying even though I am not sure how it does affect my apt-get installation even when the installation is successful.
Raspi-config internationalisation options screen |
Change Locale Error |
The solution is simple:
- sudo nano /etc/locale.gen
- uncomment your preferred locale, for example en_US.UTF-8
- sudo locale-gen en_US.UTF-8
- sudo update-locale en_US.UTF-8
Even though it help getting rid of the annoying 'cannot change locale' or '' error message in your terminal,
it doesn't fix the "There was an error running option I1 Change Locale" issue.
As I tried reconfigure Locale changes, raspi-config will still return me to the same error as in Change Local Error screenshot above.
So until now, I'm still looking for the root cause of this problem.
TL; DR
Solution on StackOverflow - Unable to reconfigure locale in raspberry pi
Original solution source was blog years ago Raspberry Pi -- Fixing your Locale