instalação postgresql danificada

0

Eu instalei o postgresql usando o seguinte comando no dia 25 seguindo as instruções em (help.ubuntu.com/community/PostgreSQL)

sudo apt-get install postgres postgresql-contrib

Estava funcionando bem. Então, no dia 27 eu instalei o postgres-xc seguindo outro tutorial e depois disso eu estou recebendo o erro "fatal postgres post não encontrado".

Log da minha instalação:

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

Após esta instalação, fui sugerido para executar o autoremove pela instalação. Aqui está o log de arquivos removidos:

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>

Eu uso o apt-get para instalar o postgres-xc. Por favor me avise como fazer meu sistema funcionar novamente?

tentou a sugestão de @ saji89 da seguinte forma:

sudo useradd -r -s /bin/false postgres

o resultado é

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

A reinstalação do postgresql teve a seguinte falha:

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.

tentou solução no link

As duas linhas superiores são comandos. O primeiro comando ficou em silêncio. Segundo deu saída. Mas o problema existe.

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:~$ 
    
por Ashutosh Nigam 28.07.2015 / 06:13

1 resposta

1

Use as etapas em como desinstalar o postgres-x para desinstalá-lo.

Em seguida, reinstale o postgresql usando

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

Certifique-se de verificar seu número de porta, pois ele pode ter sido alterado (foi alterado no meu caso).

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

Outro link referido

    
por Ashutosh Nigam 28.07.2015 / 07:52