Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
I'm trying to install postgresql as root using vagrant on a lucid32 box:
add-apt-repository ppa:pitti/postgresql
apt-get -y update
apt-get -y install postgresql libpq-dev
Installation proceeds fine until:
Setting up postgresql-9.1 (9.1.3-1~lucid) ...
Creating new cluster (configuration: /etc/postgresql/9.1/main, data: /var/lib/postgresql/9.1/main)...
initdb: encoding mismatch
The encoding you selected (UTF8) and the encoding that the
selected locale uses (LATIN1) do not match. This would lead to
misbehavior in various character string processing functions.
Rerun initdb and either do not specify an encoding explicitly,
or choose a matching combination.
Error: initdb failed
Error: could not create default cluster. Please create it manually with
pg_createcluster 9.1 main --start
or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.1/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
Setting up postgresql (9.1+128~lucid) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Then when I try to enter postgres, I get this error:
root@lucid32:~# sudo -u postgres psql
could not change directory to "/root"
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
Any help?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment