perl: warning: Please check that your locale settings:

$  sudo apt-get install wget
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "zh_CN.UTF-8",
LC_MONETARY = "zh_CN.UTF-8",
LC_ADDRESS = "zh_CN.UTF-8",
LC_TELEPHONE = "zh_CN.UTF-8",
LC_NAME = "zh_CN.UTF-8",
LC_MEASUREMENT = "zh_CN.UTF-8",
LC_IDENTIFICATION = "zh_CN.UTF-8",
LC_NUMERIC = "zh_CN.UTF-8",
LC_PAPER = "zh_CN.UTF-8",
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning:Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory

-----------------------------------
solution :
That's because when installing software, an update-locale command will be executed. This command is used to update locale.
This command is a script, written in perl, which can be found with whereis update-locale, located in /usr/sbin/update -locale

The above error is not caused by the update-locale command. There is no problem with the update-locale script, but because of perl

, the real reason is that perl uses zh_CN.UTF-8 for the system, but the system does not know zh_CN.UTF -8 is something
**************************************** The

solution is also very simple

apt-get install language-pack-zh-hans

Install a Chinese language, and the system will know zh_CN.UTF-8. At this time, using perl will not report an error. In
-depth understanding of

this situation is generally more common in vps, because ssh is generally used. The sshd connected to the vps
has this mechanism, which will bring the locale on the client to the remote machine. The
client usually sets the zh_CN.UTF-8 language to display Chinese, while the remote vps generally only has en_US .UTF-8
zh_CN.UTF-8 will report an error that cannot be found once it is brought in the past. It has been clearly stated at the beginning of the article
. Unreliable solutions

There are some solutions on the Internet, which are not very reliable, although on the surface it looks like a solution There is a problem, but it actually hides the problem. For

example , in the /etc/ssh/sshd_config file on the remote host, comment out the line AcceptEnv LANG LC_*
, then restart the remote sshd, then exit the remote, and then ssh up again.
At this time, the remote host will not bring the client's locale (zh_CN.UTF-8) over.
Of course, there will be no more errors. Unfortunately, the remote host cannot display Chinese correctly. The problem is still there, but it is shadowed. hid.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326766764&siteId=291194637