0

I installed postgresql using following command on 25th following instruction on (help.ubuntu.com/community/PostgreSQL)

sudo apt-get install postgres postgresql-contrib

It was working fine. Then on 27th I installed postgres-xc following another tutorial and after that I am getting error "fatal error postgres role not found".

Log of my installation:

2015-07-25 18:11:40 install postgresql-contrib-9.3:amd64 <none> 9.3.9-0ubuntu0.14.04
2015-07-25 18:11:42 install postgresql-contrib:all <none>    9.3+154ubuntu1
2015-07-25 18:15:42 install pgadmin3-data:all <none> 1.18.1-2
2015-07-25 18:15:44 install pgadmin3:amd64 <none> 1.18.1-2
2015-07-25 18:15:47 install pgagent:amd64 <none> 3.3.0-1
2015-07-27 20:53:45 install postgres-xc-client:amd64 <none> 1.1-2ubuntu2
2015-07-27 20:54:32 install postgres-xc:amd64 <none> 1.1-2ubuntu2

After this installation I was suggested to run autoremove by the installation. Here is the log of removed files:

2015-07-27 20:53:25 remove postgresql:all 9.3+154ubuntu1 <none>
2015-07-27 20:53:26 remove postgresql-9.1:amd64 9.1.13-0ubuntu0.13.10 <none>
2015-07-27 20:53:29 remove postgresql-contrib:all 9.3+154ubuntu1 <none>
2015-07-27 20:53:30 remove postgresql-contrib-9.3:amd64 9.3.9-0ubuntu0.14.04 <none>
2015-07-27 20:53:32 remove postgresql-9.3:amd64 9.3.9-0ubuntu0.14.04 <none>
2015-07-27 20:53:35 remove postgresql-client:all 9.3+154ubuntu1 <none>
2015-07-27 20:53:35 remove postgresql-client-9.1:amd64 9.1.13-0ubuntu0.13.10 <none>
2015-07-27 20:53:37 remove postgresql-client-9.3:amd64 9.3.9-0ubuntu0.14.04 <none>
2015-07-27 20:53:37 remove postgresql-common:all 154ubuntu1 <none>
2015-07-27 20:53:39 remove postgresql-client-common:all 154ubuntu1 <none>
2015-07-27 20:55:15 remove libossp-uuid16:amd64 1.6.2-1.3ubuntu1 <none>

I uses apt-get to install postgres-xc. Please advise me how to make my system working again?


tried suggestion from @saji89 as follows:

sudo useradd -r -s /bin/false postgres

the result is

ashutosh@ashUbuntu:~$ sudo useradd -r -s /bin/false postgres
[sudo] password for ashutosh: 
useradd: user 'postgres' already exists

Tried reinstallation of postgresql got following failure:

sudo apt-get install --reinstall postgresql postgresql-contrib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgresql : Depends: postgresql-9.3 but it is not going to be installed
 postgresql-contrib : Depends: postgresql-contrib-9.3 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

tried solution on link https://dba.stackexchange.com/questions/61850/after-installing-postgresql-and-postgres-xc-with-apt-get-i-have-psql-but-not-po

Top two line are commands. First command was silent. Second gave output. But problem exists.

ashutosh@ashUbuntu:~$ sudo updatedb
ashutosh@ashUbuntu:~$ sudo locate initdb
/usr/bin/initdb
/usr/share/locale/cs/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/de/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/es/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/fr/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/it/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ja/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ko/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/pl/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/pt_BR/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ro/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/ru/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/sv/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/tr/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/zh_CN/LC_MESSAGES/initdb-9.2.mo
/usr/share/locale/zh_TW/LC_MESSAGES/initdb-9.2.mo
/usr/share/man/man1/initdb.1.gz
ashutosh@ashUbuntu:~$ 
4
  • Can you try this answer of mine: askubuntu.com/a/442335/11932 maybe its the postgres user not being there.
    – saji89
    Jul 28, 2015 at 4:21
  • @saji89 i tried adding postgres user, but it is already existing as updated at the bottom of my question. Jul 28, 2015 at 4:29
  • Ok. Please check this out: askubuntu.com/a/363244/11932 If that also doesn't work, do a sudo apt-get update followed by sudo apt-get upgrade. And do post output of sudo apt-get upgrade, if it doesn't work.
    – saji89
    Jul 28, 2015 at 4:44
  • @saji89 tried apt-mark showhold , it seems no app is marked as hold :( Jul 28, 2015 at 4:47

1 Answer 1

1

Use steps in how to unistall postgres-x to uninstall.

Then reinstall postgresql using

sudo apt-get install --reinstall postgresql postgresql-contrib

Ensure to check your port number, as it might have been changed (It was changed in my case).

select *
postgres-# from pg_settings
postgres-# where name = 'port';

Another referred link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.