Locale Error in centos

北慕城南 提交于 2019-12-03 02:05:01

问题


Every time I login to my CentOS 6 server through SSH I get this error

Can anyone please explain what does that error mean & how to fix?

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

回答1:


The Fix: Thanks for Millie Smith (https://stackoverflow.com/users/2850543/millie-smith) & http://linuxforums.org.uk/index.php?topic=10318.0

Using root user through ssh

Run these commands

vi /etc/environment

& add these lines:

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



回答2:


Before connecting to the host via SSH, you can set LC_ALL to C, e.g.

LC_ALL=C ssh user@example.com



回答3:


I try yum reinstall glibc-common from there and @Seif Hatem's method.

but it don not work.

you can use try this.

It works.

export LANG=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_ALL=en_US.UTF-8

https://github.com/2creatives/vagrant-centos/issues/7



来源:https://stackoverflow.com/questions/22430747/locale-error-in-centos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!