Dear Tim and Adrian

Thanks for your attention.

Finally I solved the problem. In addition to deleting files as suggested it
seems to be important to *remove postgres user and group* (userdel -r
postgres, groupdel postgres) before the new install.

https://stackoverflow.com/questions/2748607/how-to-thoroughly-purge-and-reinstall-postgresql-on-ubuntu

And life goes on ...

All the best

Antonio Olinto


2018-05-09 21:15 GMT-03:00 Tim Cross <theophil...@gmail.com>:

>
>
> On 10 May 2018 at 09:45, Adrian Klaver <adrian.kla...@aklaver.com> wrote:
>
>> On 05/09/2018 02:47 PM, Antonio Silva wrote:
>>
>>> Hello Adrian
>>>
>>> Are you using the Ubuntu or Postgres repos?
>>>  > I'm using the Ubuntu repos
>>>
>>> Can you connect to Postgres using psql?
>>>  > No I cannot
>>>
>>
>> What does ps ax | grep post show?
>>
>> My guess is you are going to have to reinstall Postgres.
>>
>>
>>> Thanks
>>>
>>> Antonio
>>>
>>>
>>> 2018-05-09 10:36 GMT-03:00 Adrian Klaver <adrian.kla...@aklaver.com
>>> <mailto:adrian.kla...@aklaver.com>>:
>>>
>>>
>>>     On 05/08/2018 05:54 PM, Antonio Silva wrote:
>>>
>>>         Hello!
>>>
>>>
>>>     Comments inline.
>>>
>>>         I bought a new computer and I installed Ubuntu 18.04 and after
>>>         PostgreSQL.
>>>         sudo apt install postgresql postgresql-contrib pgadmin3
>>>
>>>
>>>     Are you using the Ubuntu or Postgres repos?
>>>
>>>
>>>         Nevertheless I had some issues with configuration files and
>>>         decided to
>>>         uninstall it completely
>>>         sudo apt purge postgresql postgresql-contrib pgadmin3
>>>
>>>         When I installed it again I notice that postgresql.conf and
>>>         pg_hba.conf
>>>         were the oldies files. Then I uninstall Postgres once more and
>>>         removed the
>>>         directory /etc/postgresql/
>>>
>>>         After a new install I noticed that the directory
>>>         /etc/postgresql/ was
>>>         completely empty - it was not created again. There are no more
>>>         postgresql.conf and pg_hba.conf files. I could find only
>>>         postgresql.conf.sample and pg_hba.conf.sample at
>>>         /usr/share/postgresql/10
>>>
>>>         /etc/init.d/postgresql status says that Postgres is running fine
>>>
>>>
>>>     Can you connect to Postgres using psql?
>>>
>>>
>>>         ● postgresql.service - PostgreSQL RDBMS
>>>         Loaded: loaded (/lib/systemd/system/postgresql.service; enabled;
>>>         vendor
>>>         preset: enabled)
>>>         Active: active (exited) since Tue 2018-05-08 10:43:23 -03; 1h
>>>         55min ago
>>>         Process: 6451 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
>>>         Main PID: 6451 (code=exited, status=0/SUCCESS)
>>>
>>>
>>>     To be running the server would need its conf files somewhere.
>>>
>>>
>>>         What should I have to do to heve the folder /etc/postgresql/10/
>>>         ... and all
>>>         its files agais?
>>>
>>>
>>>     If you are going to use the packages then yes.
>>>
>>>
>>>
>>>
>>>         I really appreciate any help. Thanks in advance.
>>>
>>>         All the best
>>>
>>>         --         Antônio Olinto Ávila da Silva
>>>
>>>
>>>
>>>     --     Adrian Klaver
>>>     adrian.kla...@aklaver.com <mailto:adrian.kla...@aklaver.com>
>>>
>>>
>>>
>>
>> --
>> Adrian Klaver
>> adrian.kla...@aklaver.com
>>
>>
> Probably not relevant, but I noticed your also installing pgadmin3. I
> don't believe pgadmin3 will work with Postgres 10. You need pgadmin4, which
> isn't available as a package on ubuntu 18.04.
>
> Also, be aware that Ubuntu has also been pushing 'snaps', so make sure
> that Postgres hasn't been installed as a snap package (I think the command
> is snap lis). I recall when I tried to install postgres in 17.10, which I
> did from the 'software centre' on ubuntu, it initially installed it as a
> snap. I had to remove the snap and then use apt to get the normal deb
> package install.  the snap package system does not use the normal locations
> for config files.
>
> This could also be a ubuntu 18.04 issue. This version was only released a
> couple of weeks ago and it is the first version which has Postgres 10 as
> the default.  I would try the following
>
> 1. use systemctl to stop postgresql service
> 2. remove all postgres packages making sure all config files are also
> removed
> 3. Use synaptic to make sure all postgres package and associated config
> files have been removed.
> 4. Reboot
> 5. run apt update and then apt upgrade
> 6 re-install using apt (not the software centre).
>
>
>
> --
> regards,
>
> Tim
>
> --
> Tim Cross
>
>

Reply via email to