Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No passwd entry for user 'postgres' error

Tags:

I'm trying to setup Postgres on Ubuntu 14.04 without success. After running

sudo apt-get install libpq-dev python-dev

and

sudo apt-get install postgresql postgresql-contrib

I've managed to install the packages successfully. However upon executing sudo su - postgres, I'm receiving the following error:

No passwd entry for user 'postgres'

It seems like the installation did not create the user postgres as it is not in the /etc/passwd file. Reinstalling the package does not resolve the issue. How can I add the required postgres user?

like image 852
zan Avatar asked Nov 30 '14 07:11

zan


1 Answers

It sounds like you want the PostgreSQL server:

apt-get install postgresql-server

Also, you never need to use sudo su - postgres. Just:

sudo -u postgres -i

to get an interactive shell, or

sudo -u postgres psql

(or whatever) to run a command.

like image 168
Craig Ringer Avatar answered Sep 28 '22 00:09

Craig Ringer