Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just set up a server running Debian 6.0 64-bit. I've installed PostgreSQL through aptitude, and now i try to access PostgreSQL without any luck. I am trying to access psql as the user postgres, but get this error message

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"?

I can't seem to find the folder where all the config files is either. On my CentOS server the config files are stored in /var/lib/pgsql, on my Debian server there is a folder called postgresqlin /var/lib but it's empty.

share|improve this question

If /var/lib/postgresql/ is empty, something is wrong. It should have a directory for each version of PostgreSQL that you have installed, assuming you did the installation through the normal dpkg/apt-get processes (which you say you did) and that the package was intended for Debian. On the other hand, you have the postgres user and the psql command available. It is certainly possible that you have one of the postgresql-client-* packages installed but not the server package.

Since you pretty clearly do not have PostgreSQL successfully running, I would suggest a purge and reinstall through aptitude, or (as root):

apt-get purge postgresql-8.4
apt-get install postgresql-8.4

One final note. PostgreSQL has its own APT repository, so if you want to use a newer version than 8.4, you can do so with little hassle. To use it, as root, add the following line to /etc/apt/sources.list:

deb squeeze-pgdg main

Then, as root:

wget --quiet -O - | apt-key add -
apt-get update && apt-get install pgdg-keyring

You can then install versions 8.2, 8.3, 8.4, 9.0, 9.1, or 9.2, as of this writing. You can have multiple versions installed at once if you like. More information is available in the documentation to the postgresql-common package:

zless /usr/share/doc/postgresql-common/README.Debian.gz
share|improve this answer

Similar error occurs, if installation is not fully complete.Try setting default language , it is one of the common problem.

sudo apt-get remove postgresql* --purge
export LANGUAGE="en_GB.UTF-8"
export LC_ALL="en_GB.UTF-8"
sudo apt-get install postgresql
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.