加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl: warning: Setting locale failed

发布时间:2020-12-15 23:52:33 所属栏目:大数据 来源:网络整理
导读:运行某些perl 编写的脚本时 报如下错误: Theory Locale is set of language/user input/keyboard characters specific to regions. For instance,"en_US" represents US english character set. It has to be set to correct value (en_US.UTF-8 or anythin

运行某些perl 编写的脚本时 报如下错误:


Theory

Locale is set of language/user input/keyboard characters specific to regions. For instance,"en_US" represents US english character set. It has to be set to correct value (en_US.UTF-8 or anything else,there are lots for different regions)for server to understand the character sequence keyboard input provides. "setlocale" enables the user to set the locale.

To read more on the theory of Locales,please divert here.?

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

What eventually worked for me

These two commands:?

执行下面这两行命令:

sudo locale-gen en_US.UTF-8 sudo dpkg-reconfigure locales

The error "bash: warning: setlocale: LC_ALL: cannot change locale (en_US)" occurs when the remote server does not understand the locale "en_US.UTF-8". The fix is to generate the locale using the command "sudo locale-gen en_US.UTF-8" and update the locale repository to store this locale,such that future connections(ssh) can understand this locale. The command "sudo dpkg-reconfigure locales" updates the local repository with the newly generated locale,i.e en_US.UTF-8.

在出现的界面选项中选择? en_US.UTF-8 (按空格选择和取消选择),enter回车,在默认选项中同样选择en_US.UTF-8,完成之后就没问题了。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读