manpath: can't set the locale; make sure $LC_* and $LANG are correct
LocaleLocale Problem Overview
I just installed terminator terminal emulator on my linux mint. for some reason I don't understand, it sets my password to some of the locale options. I've tried several things but they only offer a temporary fix. each time I open the terminal, it resets the locale options to my password.
LANG=koldenod19*
LANGUAGE=
LC_CTYPE="mypassword"
LC_NUMERIC=om_KE.UTF-8
LC_TIME="mypassword"
LC_COLLATE="mypassword"
LC_MONETARY=om_KE.UTF-8
LC_MESSAGES="mypassword"
LC_PAPER=om_KE.UTF-8
LC_NAME=om_KE.UTF-8
LC_ADDRESS=om_KE.UTF-8
LC_TELEPHONE=om_KE.UTF-8
LC_MEASUREMENT=om_KE.UTF-8
LC_IDENTIFICATION=om_KE.UTF-8
LC_ALL=
I've tried using sudo dpkg-reconfigure locales
and export LC_ALL="eo_US.utf8"
and the problem still persists.
Locale Solutions
Solution 1 - Locale
Try this https://gist.github.com/SimonSun1988/2ef7db45e46b889783647d941ec15e4d
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
and in file /etc/default/locale
add line LC_ALL="en_US.UTF-8"
and relogin to your server.
Solution 2 - Locale
For CentOS this worked for me.
Add these lines to /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
Solution 3 - Locale
Edit your /etc/locale.gen
then uncomment the following line:
en_GB.UTF-8 UTF-8
Run:
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 !!!
Solution 4 - Locale
RedHat: Change /etc/locale.conf to
LANG=en_US.UTF-8
LC_ALL=en_US.utf-8
Solution 5 - Locale
If you are having this problem on CentOS, follow this example because nothing else worked for me.
The command localedef -i en_US -f UTF-8 en_US.UTF-8
fixes the problem, but may lead to another one:
[error] character map file UTF-8' not found: No such file or directory
default character map file ANSI_X3.4-1968' not found: No such file or directory.
Finally, executing yum -y install glibc-locale-source
prior to localedef -i en_US -f UTF-8 en_US.UTF-8
installs the missing files and changes back the locale.
Now locale reports again:
LANG=en_US
.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
(...)
LC_ALL=
Hope that helps someone out there.
Solution 6 - Locale
If you encounter this issue and are working based on Docker.
Install locales first and then generate locale.
apt install locales
locale-gen en_US.UTF-8