linux(centos)登录提示cannot change locale (en_US.UTF-8)解决方案
- 2018-12-01 14:06:00
- admin 原创
- 10685
刚才远程登录linux服务器时,突然提示cannot change locale (en_US.UTF-8)警告:
-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory -bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
之前并未出现过此问题,且出现该问题之前,我在服务器部署喧喧im即时通讯软件服务端,安装了glibc。猜测是安装时软件设置了默认地区_语言.字符集为 en_US.UTF-8,但是在系统中没有定义所引起的问题。
解决方案也很简单:
$ tee /etc/environment <<- 'EOF' LANG=en_US.utf-8 LC_ALL= EOF $ source /etc/environment $ localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
运行上面命令,该问题即可解决。
版权声明
版权声明:本站原创文章,转载请注明作者和出处。
标签云集
云禅道