SetLocale warning
Using the Mac above Iterm2 for some time, the login server is always reported as follows warning
Warning:setlocale:LC_CTYPE:cannot change Locale (UTF-8): No such file or directory
Then Yum will also report LC_CTYPE environment variables when it is installed. So the time to search for a bit, found the following article http://www.cyberciti.biz/faq/os-x-terminal-bash-warning-setlocale-lc_ctype-cannot-change-locale/
The article gives 3 solutions:
1. SSH client off Set locale environment variables on startup.
2. Sudo vi ~/.ssh/config will #sendenv LANG lc_* to comment out.
3. Localedef-i en_us-f UTF-8 en_US. UTF-8
The first 2 I have tried, is OK, the key is to understand why. In fact, when SSH is connected, he will pass the environment variable, if the server does not have a local environment, it will report this error. I confirmed that the $lc_ctype is actually the result of this environment variable.
environment variable lc_ctype=utf-8 on Mac
imac:~ aca$ $LC_CTYPEUTF-8imac:~ aca$ localeLANG=LC_COLLATE="C"LC_CTYPE="UTF-8"LC_MESSAGES="C"LC_MONETARY="C"LC_NUMERIC="C"LC_TIME="C"LC_ALL=
Non-transmitting LC parameter login server
Lc_ctype= "en_US on the server. UTF-8 "
[Root@iZ28ywqw7nhZOpt# localeLANG=en_us.UTF-8lc_ctype="en_US. UTF-8 "lc_numeric="en_US. UTF-8 "Lc_time="en_US. UTF-8 "lc_collate="en_US. UTF-8 "lc_monetary="en_US. UTF-8 "lc_messages="en_US. UTF-8 "Lc_paper="en_US. UTF-8 "Lc_name="en_US. UTF-8 "lc_address="en_US. UTF-8 "Lc_telephone="en_US. UTF-8 "lc_measurement="en_US. UTF-8 "lc_identification="en_US. UTF-8 "Lc_all=[root@iZ28ywqw7nhZOpt# echo $LC _ctype
Transfer LC Parameter Login server
[Email protected] ~]# echo "$LC _ctype" Utf-8[[email protected] ~]# Localelocale:cannotSetLc_ctype to defaultLocaleNoSuch fileorDirectorylocale:cannotSetLc_all to defaultLocaleNoSuch fileorDirectorylang=en_us. utf-8lc_ctype=utf-8Lc_numeric="en_US. UTF-8 "Lc_time="en_US. UTF-8 "Lc_collate="en_US. UTF-8 "lc_monetary="en_US. UTF-8 "lc_messages="en_US. UTF-8 "Lc_paper="en_US. UTF-8 "Lc_name="en_US. UTF-8 "lc_address="en_US. UTF-8 "Lc_telephone="en_US. UTF-8 "Lc_measurement="en_US. UTF-8 "lc_identification="en_US. UTF-8 "Lc_all=
The lc_ctype=utf-8 of the server is caused by the parameters passed.
Can see note is lc_ctype this parameter, Mac above is UTF-8, server above cannot recognize UTF-8, generally is "en_US." UTF-8 ", so will be reported cannot change locale (UTF-8): No Such file or directory this warning. The reason for this.
Warning:setlocale:LC_CTYPE:cannot change Locale