Sunday, August 30, 2020

Remove PostgreSQL in Ubuntu 18.04

Once I was using PostgreSQL and when I no longer need to keep the installation, I wanted to remove it completely. 

So I used the command listed below to remove the PostgreSQL.

#sudo apt-get --purge remove postgresql  

Even though the un-installation was successful, when I go to login there's still a "PostgreSQL" user. I tried running sudo deluser PostgreSQL but all I get is

/usr/sbin/deluser: The user `PostgreSQL' does not exist.

In order to verify the existence of the user, I checked the passwd file.

cat /etc/passwd | grep -i postgre
postgres:x:1001:1001:PostgreSQL:/opt/ManageEngine/OpManager/pgsql:/bin/sh

Then only I realized that the Login Name and User Name are not the same. So I tried removing the user "postgres" using the command below and it was successful. 

sudo deluser postgres


 

 

 

0 comments: