Skip to content

Instantly share code, notes, and snippets.

@paniwani
Created April 27, 2012 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paniwani/2510145 to your computer and use it in GitHub Desktop.
Save paniwani/2510145 to your computer and use it in GitHub Desktop.
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