Perl的语言环境警告会阻止Postgres配置

时间:2015-07-09 10:25:27

标签: perl postgresql ubuntu azure

所以我想在运行Ubuntu 14.04的Microsoft Azure服务器上设置Postgres。我需要建立一个集群:

user@mysystem:~$ pg_createcluster
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_PAPER = "nb_NO.UTF-8",
    LC_ADDRESS = "nb_NO.UTF-8",
    LC_MONETARY = "nb_NO.UTF-8",
    LC_NUMERIC = "nb_NO.UTF-8",
    LC_TELEPHONE = "nb_NO.UTF-8",
    LC_IDENTIFICATION = "nb_NO.UTF-8",
    LC_MEASUREMENT = "nb_NO.UTF-8",
    LC_TIME = "nb_NO.UTF-8",
    LC_NAME = "nb_NO.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Error: The locale requested by the environment is invalid.

我尝试了什么:

  • LANG=en_US.UTF-8添加到/etc/environment
  • 正在运行sudo locale-gen en_US.UTF-8(以及我自己的排版,挪威语)

经过大量谷歌搜索后,我发现this问题和答案,这与我的情况相同。问题是接受的答案中没有任何建议对我有用,但我认为可能是与我的主机和Azure云机不同的排版所指出的问题可能是问题的根源。我还没有找到任何帮助我的东西。

请注意,perl-warning也会附带其他与Postgres相关的命令,包括启动Postgres服务器或客户端程序。

非常感谢所有帮助。提前致谢!

1 个答案:

答案 0 :(得分:1)

这是因为通过ssh连接 将此行添加到.profile或.bashrc

export LC_ALL="nb_NO.UTF-8"
export LANGUAGE="nb_NO.UTF-8"
export LC_CTYPE="nb_NO.UTF-8"