Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On a new copy of Ubuntu 11.04 server I am trying to install PostgreSQL server by apt-get install postgresql. But in the end of installation log I saw:

Error: could not create default cluster. Please create it manually with

  pg_createcluster 8.4 main --start

When I ran this command I saw this message:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
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.

And no PostgreSQL server started :(

What I need to do to become happy on this?

share|improve this question
What's the output of "locale -a"? –  Milen A. Radev Sep 5 '11 at 17:52

3 Answers 3

The current environment variables have effect as well. Use the command


to see what is seen by Postgres, and update using export statements, e.g.:

export LANGUAGE="en_US.UTF-8"
share|improve this answer
up vote 2 down vote accepted

This lines are helped me:

echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale
echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale
share|improve this answer

Luckily for you this is an issue I had to look up my notes on, but you asked it in September 2011.

Check these links - Enlist the help of Google Translate




share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.