Change the owner of /var/run/postgresql and set it to postgres:
sudo chown -R postgres:postgres /var/run/postgresql
If the user you are running as does not have sudo privilege, then
-
Change to root:
su - -
Change ownership of
/var/run/postgresqlto userpostgresand grouppostgres:chown -R postgres:postgres /var/run/postgresql
I had the same problem when installing postgres on Ubuntu 14.04 and changing the ownership fixed the problem for me.