问题
When I tried to install bitnami odoo 9 in my ubuntu system via terminal, I got the following error message.
How to solve this issue?
initdb.bin: invalid locale settings; check LANG and LC_* environment variables
Thanks in advance!
回答1:
The issue solved when i used the following commands
LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
回答2:
On the docker image I was using every single locale was commented out in the /etc/locale.gen file. Meaning no locale was setup, which was causing this error.
Because I was scripting the build I ran the following two commands to fix the problem (you may want to manually edit /etc/locale.gen, if you want to avoid my nuclear option of overwriting the whole file)
echo en_US.UTF-8 UTF-8 > /etc/locale.gen
locale-gen en_US.UTF-8
回答3:
For me it is part of using ssh
So edit sshd config file
/etc/ssh/sshd_config
and change LANG part it to this:
AcceptEnv LANG en_US.UTF-8
then restart ssh and reconnect
sudo service sshd restart
回答4:
On Ubuntu Ubuntu 19.04 (Disco Dingo) I had to set all these.
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
The full doc is here.
来源:https://stackoverflow.com/questions/41956994/initdb-bin-invalid-locale-settings-check-lang-and-lc-environment-variables