19

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!

Jithin U. Ahmed
  • 1,495
  • 1
  • 19
  • 29

4 Answers4

48

The issue solved when i used the following commands

LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"

For Unix you have to be

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
Stefano Mtangoo
  • 6,017
  • 6
  • 47
  • 93
Karthik CP
  • 1,150
  • 13
  • 24
6

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
Iain Hunter
  • 4,319
  • 1
  • 27
  • 13
3

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.

1

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
SpiRail
  • 1,377
  • 19
  • 28