[SOLVED] [CentOS 6.2] setlocale issue

Hi there,

Dont know if I post at the correct forum but ok. I do have a little ‘annoying’ issue on my CentOS 6.2 installation.
Every time I connect with SSH or just on the terminal via VMWare vSphere I see this message:


-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

But I also see it when I run ‘make’ or ‘configure’.

What can I do to fix this?

Thanks in advance!

Try adding:-

export LC_CTYPE="en_US.UTF-8"

to

~/.bash_profile

[EDIT]

Is the locale OK for root ?

The last posting here may be of interest:
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=32334

I’ve added it but it still occurs.

This is the content of the ~/.bash_profile:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export LC_CTYPE="en_US.UTF-8"

And no this occurs under root

Take a look at the edit above.

[EDIT]

I also forgot to mention, you’d need to log off/on again before the edit to ~/.bash_profile would take affect.

What’s the output from:

locale

as both root and your user ?

I fixed it now using this fix:

cat /etc/environment

this file should be empty

Then create it using

vi /etc/environment

And add the following lines:

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Nice … and thanks for the solution, seems a lot of people are having this issue in CentOS … and either there are multiple fixes, or conflicting information.

Yes indeed. But I also see it with Fedora and Debian users.
But the main thing is that this solution works without installing anything etc so.

Think is a generic solution

Mmm … seems it’s all over the web ???

Already tried a few things before I ran into this solution.
But as you also said there some solutions which can conflict with some other things…

But now the solution is also known here :slight_smile: