I got warning setlocale LC_CTYPE when I ssh connect to vagrant centos 6 I got warning setlocale LC_CTYPE when I ssh connect to vagrant centos 6 linux linux

I got warning setlocale LC_CTYPE when I ssh connect to vagrant centos 6


For CentOS or Amazon AMI Linux, add these lines to /etc/environment (create it, if it doesn't exist):

LANG=en_US.UTF-8LC_ALL=en_US.UTF-8

To edit this file via SSH console, try

sudo nano /etc/environment

Edit

For Debian-related distributions (Ubuntu, etc.), you should check that /etc/default/locale is empty. That's the outcome of choosing None in dpkg-reconfigure locales which is suggested if users access via SSH (see Debian Wiki).

/etc/environment is deprecated since Debian Lenny (5.0).


Under root in bashrc add following :

vi /root/.bashrcexport LC_ALL=en_US.UTF-8export LANG=en_US.UTF-8

And reboot your system afterwards.


In my case, on Slackware64 14.1 I got the error:

-bash: warning: setlocale: LC_ALL: cannot change locale (en_DK.UTF-8)

It turned out to be missing glibc packages.

Installing the packages:

glibc-2.17-x86_64-11_slack14.1glibc-i18n-2.17-x86_64-11_slack14.1

Solved the problem.

My /etc/profile.d/lang.sh contains:

export LANG=en_DK.UTF-8export LANGUAGE=en_DK.UTF-8export LC_ALL=en_DK.UTF-8export LC_COLLATE=C

Enjoy.