0

I am currently trying to install and setup PostreSQL on my computer (Debian 9) so I can use it as a local testing environment for Heroku. I have been having some problems. First, whenever I try to run psql (and similar commands), I get this error:

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 have looked around on here for some fixes to this, such as this one, however I cannot find the postmaster.pid anywhere inside /usr. When looking for /var/run/postgresql, my search also turned up nothing.

Another promising answer was this one, however, I run pg_lsclusters, none appear. From a bit of searching, it says that this is probably due to initdb never being ran. I looked around for several ways to do this manually; none of them have worked or appear to exist on my system.

I have tried many of the "simple" things, such as sudo, sudo su postgres, removing and reinstalling the package and screaming at the computer.

What exactly is going on here? How do I fix it?

My OS (as mentioned before) is Debian 9, and the psql --version (which does work) is psql (PostgreSQL) 10.4 (Debian 10.4-2.pgdg90+1).

Owen McGrath
  • 391
  • 1
  • 3
  • 7
  • be sure to install the packages `postgresql-server` and `postgresql-common` – Jasen Aug 02 '18 at 10:57
  • @Jasen I installed `postgresql-common`, however installing the former results in `Package 'postgresql-server' has no installation candidate`; `psql` still doesn't work – Owen McGrath Aug 04 '18 at 20:16

0 Answers0