manpath: can't set the locale; make sure $LC_* and $LANG are correct
Asked Answered
S

8

78

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.

Spermogonium answered 1/9, 2017 at 7:48 Comment(1)
This worked for me: enter link description hereIndigoid
G
144

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.

Goodygoody answered 26/10, 2017 at 5:26 Comment(5)
WHat's the name of the YUM package ? (running Amazon-linux 2, cannot find locale-gen)Diplomatics
@CyrilDuchon-Doris try just add line LC_ALL... maybe it will work for you without any extra commandsGoodygoody
This works, though I still don't know what caused this issue in the first place, probably due to some encoding package that I installed or an upgrade to python ?Vociferate
Something seems to be implied, but hasn't actually been confirmed... Do all the locale variables need to use an en_US or en_GB locale for these errors to go away? My LC_* variables are a mix of en_US and ms_MY, which is correct for me (American living in Malaysia), but I'm getting the same error.Wessling
@Wessling just LC_ALL should be in locale fileGoodygoody
Z
55

For CentOS this worked for me.

Add these lines to /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8
Ziguard answered 29/1, 2020 at 16:23 Comment(7)
This worked for me on AWS Amazon Linux AMIBlowfly
Also on Debian Wheezy/JessieTicktock
It works also on Ubuntu 20.04 Focal FossaAubarta
Also worked for my Manjaro system.Stokehole
Worked for me on debian 10Infidel
Worked on Arch LinuxDissipation
Worked for me on Debian 11Ozonize
T
12

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 !!!

Transmit answered 30/8, 2020 at 13:15 Comment(0)
P
3

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
Pelotas answered 10/3, 2022 at 9:31 Comment(0)
I
3

This worked for me :

echo "LC_ALL=en_US.UTF-8" >> /etc/environment
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen en_US.UTF-8

Source

Indigoid answered 19/1, 2023 at 7:24 Comment(0)
P
2

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.

Pappose answered 22/2, 2022 at 13:4 Comment(1)
work for me on centos.Obediah
G
1

RedHat: Change /etc/locale.conf to

LANG=en_US.UTF-8
LC_ALL=en_US.utf-8
Gadgeteer answered 14/2, 2022 at 8:52 Comment(0)
P
1

This answer is only relevant to KDE / Plasma:

Assuming that you still have these issues after the solutions shown in the top answers, you could look for a file located at ~/.config/plasma-localerc.

Plasma does store Locale Configurations here — but they would be better of in /etc/locale.conf.

Anyhow, after doing the rename / delete and doing a reboot, the error should no longer be present. You can run locale to get the detailed locale setup. Modify the /etc/locale.conf file as needed.

Solution Reference: https://forum.manjaro.org/t/manpath-cant-set-locale/20099/8

Painter answered 24/3 at 12:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.