Postgres语言环境错误

我在Ubuntu上的Digital River上安装了一个Postgres数据库,并按照以下说明安装 :

但是,区域设置有些问题,我无法弄清楚如何解决这个问题。 当我运行psql命令时出现以下错误:

postgres@assay:/home/deployer$ psql perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). psql (9.1.9) 

在Digital River论坛上非常感谢Kamal Nasser提供的正确答案( 以下命令需要root权限 ):

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

我想这是正确的链接到原来的答案:数字海洋网站没有响应,所以我不能检查它。 https://www.digitalocean.com/community/questions/postgresql-and-rails-4

在尝试ardochhigh的答案后:

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

问题依然存在

之后,我看到这个答案,为我解决了这个问题:

https://www.digitalocean.com/community/questions/language-problem-on-ubuntu-14-04

Aparently LAGUAGE shell变量没有设置:

 $ sudo bash $ export LANGUAGE="en_US.UTF-8" $ echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale $ echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale $ # next: logout and login