CentOS 7可以正常登录,但是root每次登录都有几行警告

1、登录账户或切换账户时出现以下警告 ,如图

-bash: warning: setlocale: LC_CTYPE: cannot change locale (en US.UTF-8):no such file or directoty

-bash: warning: setlocale: LC_COLLATE: cannot change locale (en US.UTF-8):no such file or directoty

-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en US.UTF-8):no such file or directoty

-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en US.UTF-8):no such file or directoty

-bash: warning: setlocale: LC_TIME: cannot change locale (en US.UTF-8):no such file or directoty

 

 实际上并非中文英文的问题,解决方法:vi /etc/environment,在文件里添加两行这个东西:

LANG=en_US.utf-8

LC_ALL=en_US.utf-8

保存退出,重启系统使environment文件生效(暂时好像只有重启系统才能使这个文件生效),重新登录,问题解决

猜你喜欢

转载自www.cnblogs.com/will-wu/p/11985739.html