How to remove Postgres from my installation?
up vote
59
down vote
favorite
I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but there was an error, and the Postgres was not installed and the application is not working. I had tryed to update the Postgres and nothing, only the message "there was an error and your postgres can not be installed"
Now I want to remove completely the Postgres from my machine, how can I do that, I do not want to kill the process every boot. I just want to remove Postgres.
What is the command line?
Thanks people.
command-line 9.10 postgresql
add a comment |
up vote
59
down vote
favorite
I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but there was an error, and the Postgres was not installed and the application is not working. I had tryed to update the Postgres and nothing, only the message "there was an error and your postgres can not be installed"
Now I want to remove completely the Postgres from my machine, how can I do that, I do not want to kill the process every boot. I just want to remove Postgres.
What is the command line?
Thanks people.
command-line 9.10 postgresql
add a comment |
up vote
59
down vote
favorite
up vote
59
down vote
favorite
I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but there was an error, and the Postgres was not installed and the application is not working. I had tryed to update the Postgres and nothing, only the message "there was an error and your postgres can not be installed"
Now I want to remove completely the Postgres from my machine, how can I do that, I do not want to kill the process every boot. I just want to remove Postgres.
What is the command line?
Thanks people.
command-line 9.10 postgresql
I have ubuntu 9.10(karmic), and when I attempted to install a new program, the postgres was installed as a dependency of that program, no problem at all if the installation occurs with success, but there was an error, and the Postgres was not installed and the application is not working. I had tryed to update the Postgres and nothing, only the message "there was an error and your postgres can not be installed"
Now I want to remove completely the Postgres from my machine, how can I do that, I do not want to kill the process every boot. I just want to remove Postgres.
What is the command line?
Thanks people.
command-line 9.10 postgresql
command-line 9.10 postgresql
edited Mar 31 '11 at 0:39
Jorge Castro
35.7k105422617
35.7k105422617
asked Mar 30 '11 at 20:03
B4NZ41
4291613
4291613
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
up vote
105
down vote
accepted
The simplest way to do this is to open a terminal and type:
sudo apt-get --purge remove postgresql
This will also prompt you to remove that software that depends on Postgres, which in this case it appears you would like to do.
I do not personally run 9.10 or Postgres, so it is possible that Postgres installs itself in several parts. In that case, a simple:
dpkg -l | grep postgres
Will get you the list of those packages that Postgres installed.
Then, just use the same "apt-get --purge remove ...." command but instead of just postgresql, type each package name, separated by spaces, like:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
This is dependent on the list of packages installed, of course.
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
It should bedpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
add a comment |
up vote
60
down vote
Steps that worked for me on Ubuntu 8.04.2
to remove postgres 8.3
List All Postgres related packages
dpkg -l | grep postgres
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi
ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager
ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest
ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL
Remove all above listed
sudo apt-get --purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3
Remove the following folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
Step 3 can be combined into one line if using bash shellsudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
add a comment |
up vote
17
down vote
One command to completely remove postgresql in terminal is sudo apt-get --purge remove postgresql*
. Please note that this command will remove postgresql and all it's compenents.
5
I usedsudo apt-get purge postgresql*
on 14.04
– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
add a comment |
up vote
0
down vote
Thanks to Code Friendly
, & I want to share how I solved my problem.
When I updated postgresql
from the Synaptic application, it is the postgresql 10 version that was installed. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. Postgresql 9.6
listening on port 5432
. Postgresql 10
listening on port 5433
instead of 5432.
When I run the comand msfconsole
in a terminal, although metasploit connects to the msf database on port 5432, the following error message appears:
root@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I unistall the 9.6 postgresql version from the Synaptic application, but the problem persists (postgresql 9.6 no longer appears in synaptic's installed software list);
But by executing the command that follows we see that the version postgresql 9.6 was not completely unistalled:
root@kali:~# dpkg -l | grep postgresql
ii postgresql 10+187 all object-relational SQL database (supported version)
ii postgresql-9.6 ** all object-relational SQL database, version 9.6 server
ii postgresql-10 10.0-1+b1 amd64 object-relational SQL database, version 10 server
ii postgresql-client-10 10.0-1+b1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-common 187 all manager for multiple PostgreSQL client versions
ii postgresql-common 187 all PostgreSQL database cluster manager
ii postgresql-contrib 10+187 all additional facilities for PostgreSQL (supported version)
With the following command, postgresql-9.6 uninstalled completely:root@kali:~# sudo apt-get --purge remove postgresql-9.6
Then I edited the file /etc/postgresql/10/main/postgresql.conf
, changed the port number to 5432 and the problem is solved.
Another error message appears:
Creating initial database schema /usr/local/bin/bundle:22:in ``load': cannot load such file -- /usr/lib/ruby/exe/bundle (LoadError) from /usr/local/bin/bundle:22:in `<main>
I found that the cause was that two (2) versions of Ruby are installed in my debian machine, versions (2.2 & 2.3).
Same thing, I uninstall the ruby 2.2 version from the synaptic application and the problem is solved, metasploit starts without problems.
add a comment |
up vote
0
down vote
Follow the commands:
- sudo apt-get --purge remove postgresql
List all postgres related packages:
- dpkg -l | grep postgres
remove all the above listed packages using the command :
- apt-get --purge remove package1 package2 ..
Confirm all the files and folders related to postgres/postgresql are deleted using the command :
- whereis postgres
- whereis postgresql
Remove all the files and folders listed using rm command.
Delete the user postgres using the command :
- userdel -f postgres
happy coding :)
New contributor
add a comment |
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
105
down vote
accepted
The simplest way to do this is to open a terminal and type:
sudo apt-get --purge remove postgresql
This will also prompt you to remove that software that depends on Postgres, which in this case it appears you would like to do.
I do not personally run 9.10 or Postgres, so it is possible that Postgres installs itself in several parts. In that case, a simple:
dpkg -l | grep postgres
Will get you the list of those packages that Postgres installed.
Then, just use the same "apt-get --purge remove ...." command but instead of just postgresql, type each package name, separated by spaces, like:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
This is dependent on the list of packages installed, of course.
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
It should bedpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
add a comment |
up vote
105
down vote
accepted
The simplest way to do this is to open a terminal and type:
sudo apt-get --purge remove postgresql
This will also prompt you to remove that software that depends on Postgres, which in this case it appears you would like to do.
I do not personally run 9.10 or Postgres, so it is possible that Postgres installs itself in several parts. In that case, a simple:
dpkg -l | grep postgres
Will get you the list of those packages that Postgres installed.
Then, just use the same "apt-get --purge remove ...." command but instead of just postgresql, type each package name, separated by spaces, like:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
This is dependent on the list of packages installed, of course.
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
It should bedpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
add a comment |
up vote
105
down vote
accepted
up vote
105
down vote
accepted
The simplest way to do this is to open a terminal and type:
sudo apt-get --purge remove postgresql
This will also prompt you to remove that software that depends on Postgres, which in this case it appears you would like to do.
I do not personally run 9.10 or Postgres, so it is possible that Postgres installs itself in several parts. In that case, a simple:
dpkg -l | grep postgres
Will get you the list of those packages that Postgres installed.
Then, just use the same "apt-get --purge remove ...." command but instead of just postgresql, type each package name, separated by spaces, like:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
This is dependent on the list of packages installed, of course.
The simplest way to do this is to open a terminal and type:
sudo apt-get --purge remove postgresql
This will also prompt you to remove that software that depends on Postgres, which in this case it appears you would like to do.
I do not personally run 9.10 or Postgres, so it is possible that Postgres installs itself in several parts. In that case, a simple:
dpkg -l | grep postgres
Will get you the list of those packages that Postgres installed.
Then, just use the same "apt-get --purge remove ...." command but instead of just postgresql, type each package name, separated by spaces, like:
sudo apt-get --purge remove postgresql postgresql-doc postgresql-common
This is dependent on the list of packages installed, of course.
edited May 9 at 16:44
answered Mar 30 '11 at 20:21
Code Friendly
1,77411212
1,77411212
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
It should bedpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
add a comment |
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
It should bedpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
All right, I will try later, for now, thank you very much!
– B4NZ41
Mar 30 '11 at 20:26
1
1
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I run the command line --> sudo apt-get --purge remove postgresql and looks like it was removed from my ubuntu.. I'm waiting the update, always on update postgres show up the error. thanks anyway.
– B4NZ41
Apr 8 '11 at 23:34
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
I thought it was right. But today I got the same warning again, a crash system, something try to update the postgres, but it not happen, then the crash report has showed itself.. some suggestions? thanks again.
– B4NZ41
Apr 12 '11 at 18:00
2
2
It should be
dpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
It should be
dpkg -l | grep postgres
– Mithun Sreedharan
Mar 8 '12 at 13:53
add a comment |
up vote
60
down vote
Steps that worked for me on Ubuntu 8.04.2
to remove postgres 8.3
List All Postgres related packages
dpkg -l | grep postgres
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi
ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager
ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest
ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL
Remove all above listed
sudo apt-get --purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3
Remove the following folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
Step 3 can be combined into one line if using bash shellsudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
add a comment |
up vote
60
down vote
Steps that worked for me on Ubuntu 8.04.2
to remove postgres 8.3
List All Postgres related packages
dpkg -l | grep postgres
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi
ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager
ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest
ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL
Remove all above listed
sudo apt-get --purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3
Remove the following folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
Step 3 can be combined into one line if using bash shellsudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
add a comment |
up vote
60
down vote
up vote
60
down vote
Steps that worked for me on Ubuntu 8.04.2
to remove postgres 8.3
List All Postgres related packages
dpkg -l | grep postgres
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi
ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager
ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest
ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL
Remove all above listed
sudo apt-get --purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3
Remove the following folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
Steps that worked for me on Ubuntu 8.04.2
to remove postgres 8.3
List All Postgres related packages
dpkg -l | grep postgres
ii postgresql 8.3.17-0ubuntu0.8.04.1 object-relational SQL database (latest versi
ii postgresql-8.3 8.3.9-0ubuntu8.04 object-relational SQL database, version 8.3
ii postgresql-client 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL (latest ve
ii postgresql-client-8.3 8.3.9-0ubuntu8.04 front-end programs for PostgreSQL 8.3
ii postgresql-client-common 87ubuntu2 manager for multiple PostgreSQL client versi
ii postgresql-common 87ubuntu2 PostgreSQL database-cluster manager
ii postgresql-contrib 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL (latest
ii postgresql-contrib-8.3 8.3.9-0ubuntu8.04 additional facilities for PostgreSQL
Remove all above listed
sudo apt-get --purge remove postgresql postgresql-8.3 postgresql-client postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-contrib postgresql-contrib-8.3
Remove the following folders
sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
answered Mar 8 '12 at 14:31
Mithun Sreedharan
1,56721620
1,56721620
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
Step 3 can be combined into one line if using bash shellsudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
add a comment |
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
Step 3 can be combined into one line if using bash shellsudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
Thanks! but I'm not using ubuntu anymore. Now I'm on opensuse and centos. Thanks anyway, if I have troubles again with postgres your answer will be useful.
– B4NZ41
Mar 8 '12 at 16:22
1
1
Step 3 can be combined into one line if using bash shell
sudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
Step 3 can be combined into one line if using bash shell
sudo rm -rf {/var/{lib,log},etc}/postgresql/
– smac89
Oct 5 '17 at 16:22
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
+1 for step 3 here. That was key for me. Tried removing the packages several times but there was cruft left behind in /var/lib/postgresql and /etc/postgresql that was causing subsequent operations after reinstall to fail.
– Gil Hamilton
Jan 29 at 23:14
add a comment |
up vote
17
down vote
One command to completely remove postgresql in terminal is sudo apt-get --purge remove postgresql*
. Please note that this command will remove postgresql and all it's compenents.
5
I usedsudo apt-get purge postgresql*
on 14.04
– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
add a comment |
up vote
17
down vote
One command to completely remove postgresql in terminal is sudo apt-get --purge remove postgresql*
. Please note that this command will remove postgresql and all it's compenents.
5
I usedsudo apt-get purge postgresql*
on 14.04
– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
add a comment |
up vote
17
down vote
up vote
17
down vote
One command to completely remove postgresql in terminal is sudo apt-get --purge remove postgresql*
. Please note that this command will remove postgresql and all it's compenents.
One command to completely remove postgresql in terminal is sudo apt-get --purge remove postgresql*
. Please note that this command will remove postgresql and all it's compenents.
answered Feb 12 '14 at 6:02
user3146785
17113
17113
5
I usedsudo apt-get purge postgresql*
on 14.04
– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
add a comment |
5
I usedsudo apt-get purge postgresql*
on 14.04
– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
5
5
I used
sudo apt-get purge postgresql*
on 14.04– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
I used
sudo apt-get purge postgresql*
on 14.04– Antonios Hadjigeorgalis
Aug 6 '16 at 22:39
add a comment |
up vote
0
down vote
Thanks to Code Friendly
, & I want to share how I solved my problem.
When I updated postgresql
from the Synaptic application, it is the postgresql 10 version that was installed. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. Postgresql 9.6
listening on port 5432
. Postgresql 10
listening on port 5433
instead of 5432.
When I run the comand msfconsole
in a terminal, although metasploit connects to the msf database on port 5432, the following error message appears:
root@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I unistall the 9.6 postgresql version from the Synaptic application, but the problem persists (postgresql 9.6 no longer appears in synaptic's installed software list);
But by executing the command that follows we see that the version postgresql 9.6 was not completely unistalled:
root@kali:~# dpkg -l | grep postgresql
ii postgresql 10+187 all object-relational SQL database (supported version)
ii postgresql-9.6 ** all object-relational SQL database, version 9.6 server
ii postgresql-10 10.0-1+b1 amd64 object-relational SQL database, version 10 server
ii postgresql-client-10 10.0-1+b1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-common 187 all manager for multiple PostgreSQL client versions
ii postgresql-common 187 all PostgreSQL database cluster manager
ii postgresql-contrib 10+187 all additional facilities for PostgreSQL (supported version)
With the following command, postgresql-9.6 uninstalled completely:root@kali:~# sudo apt-get --purge remove postgresql-9.6
Then I edited the file /etc/postgresql/10/main/postgresql.conf
, changed the port number to 5432 and the problem is solved.
Another error message appears:
Creating initial database schema /usr/local/bin/bundle:22:in ``load': cannot load such file -- /usr/lib/ruby/exe/bundle (LoadError) from /usr/local/bin/bundle:22:in `<main>
I found that the cause was that two (2) versions of Ruby are installed in my debian machine, versions (2.2 & 2.3).
Same thing, I uninstall the ruby 2.2 version from the synaptic application and the problem is solved, metasploit starts without problems.
add a comment |
up vote
0
down vote
Thanks to Code Friendly
, & I want to share how I solved my problem.
When I updated postgresql
from the Synaptic application, it is the postgresql 10 version that was installed. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. Postgresql 9.6
listening on port 5432
. Postgresql 10
listening on port 5433
instead of 5432.
When I run the comand msfconsole
in a terminal, although metasploit connects to the msf database on port 5432, the following error message appears:
root@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I unistall the 9.6 postgresql version from the Synaptic application, but the problem persists (postgresql 9.6 no longer appears in synaptic's installed software list);
But by executing the command that follows we see that the version postgresql 9.6 was not completely unistalled:
root@kali:~# dpkg -l | grep postgresql
ii postgresql 10+187 all object-relational SQL database (supported version)
ii postgresql-9.6 ** all object-relational SQL database, version 9.6 server
ii postgresql-10 10.0-1+b1 amd64 object-relational SQL database, version 10 server
ii postgresql-client-10 10.0-1+b1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-common 187 all manager for multiple PostgreSQL client versions
ii postgresql-common 187 all PostgreSQL database cluster manager
ii postgresql-contrib 10+187 all additional facilities for PostgreSQL (supported version)
With the following command, postgresql-9.6 uninstalled completely:root@kali:~# sudo apt-get --purge remove postgresql-9.6
Then I edited the file /etc/postgresql/10/main/postgresql.conf
, changed the port number to 5432 and the problem is solved.
Another error message appears:
Creating initial database schema /usr/local/bin/bundle:22:in ``load': cannot load such file -- /usr/lib/ruby/exe/bundle (LoadError) from /usr/local/bin/bundle:22:in `<main>
I found that the cause was that two (2) versions of Ruby are installed in my debian machine, versions (2.2 & 2.3).
Same thing, I uninstall the ruby 2.2 version from the synaptic application and the problem is solved, metasploit starts without problems.
add a comment |
up vote
0
down vote
up vote
0
down vote
Thanks to Code Friendly
, & I want to share how I solved my problem.
When I updated postgresql
from the Synaptic application, it is the postgresql 10 version that was installed. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. Postgresql 9.6
listening on port 5432
. Postgresql 10
listening on port 5433
instead of 5432.
When I run the comand msfconsole
in a terminal, although metasploit connects to the msf database on port 5432, the following error message appears:
root@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I unistall the 9.6 postgresql version from the Synaptic application, but the problem persists (postgresql 9.6 no longer appears in synaptic's installed software list);
But by executing the command that follows we see that the version postgresql 9.6 was not completely unistalled:
root@kali:~# dpkg -l | grep postgresql
ii postgresql 10+187 all object-relational SQL database (supported version)
ii postgresql-9.6 ** all object-relational SQL database, version 9.6 server
ii postgresql-10 10.0-1+b1 amd64 object-relational SQL database, version 10 server
ii postgresql-client-10 10.0-1+b1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-common 187 all manager for multiple PostgreSQL client versions
ii postgresql-common 187 all PostgreSQL database cluster manager
ii postgresql-contrib 10+187 all additional facilities for PostgreSQL (supported version)
With the following command, postgresql-9.6 uninstalled completely:root@kali:~# sudo apt-get --purge remove postgresql-9.6
Then I edited the file /etc/postgresql/10/main/postgresql.conf
, changed the port number to 5432 and the problem is solved.
Another error message appears:
Creating initial database schema /usr/local/bin/bundle:22:in ``load': cannot load such file -- /usr/lib/ruby/exe/bundle (LoadError) from /usr/local/bin/bundle:22:in `<main>
I found that the cause was that two (2) versions of Ruby are installed in my debian machine, versions (2.2 & 2.3).
Same thing, I uninstall the ruby 2.2 version from the synaptic application and the problem is solved, metasploit starts without problems.
Thanks to Code Friendly
, & I want to share how I solved my problem.
When I updated postgresql
from the Synaptic application, it is the postgresql 10 version that was installed. So I had two versions of postgresql (10 & 9.6) installed in my debian machine. Postgresql 9.6
listening on port 5432
. Postgresql 10
listening on port 5433
instead of 5432.
When I run the comand msfconsole
in a terminal, although metasploit connects to the msf database on port 5432, the following error message appears:
root@kali:~# msfconsole
[-] Failed to connect to the database: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
I unistall the 9.6 postgresql version from the Synaptic application, but the problem persists (postgresql 9.6 no longer appears in synaptic's installed software list);
But by executing the command that follows we see that the version postgresql 9.6 was not completely unistalled:
root@kali:~# dpkg -l | grep postgresql
ii postgresql 10+187 all object-relational SQL database (supported version)
ii postgresql-9.6 ** all object-relational SQL database, version 9.6 server
ii postgresql-10 10.0-1+b1 amd64 object-relational SQL database, version 10 server
ii postgresql-client-10 10.0-1+b1 amd64 front-end programs for PostgreSQL 10
ii postgresql-client-common 187 all manager for multiple PostgreSQL client versions
ii postgresql-common 187 all PostgreSQL database cluster manager
ii postgresql-contrib 10+187 all additional facilities for PostgreSQL (supported version)
With the following command, postgresql-9.6 uninstalled completely:root@kali:~# sudo apt-get --purge remove postgresql-9.6
Then I edited the file /etc/postgresql/10/main/postgresql.conf
, changed the port number to 5432 and the problem is solved.
Another error message appears:
Creating initial database schema /usr/local/bin/bundle:22:in ``load': cannot load such file -- /usr/lib/ruby/exe/bundle (LoadError) from /usr/local/bin/bundle:22:in `<main>
I found that the cause was that two (2) versions of Ruby are installed in my debian machine, versions (2.2 & 2.3).
Same thing, I uninstall the ruby 2.2 version from the synaptic application and the problem is solved, metasploit starts without problems.
edited Nov 2 '17 at 0:33
J. Starnes
1,411416
1,411416
answered Nov 1 '17 at 23:03
Internaut 06
1
1
add a comment |
add a comment |
up vote
0
down vote
Follow the commands:
- sudo apt-get --purge remove postgresql
List all postgres related packages:
- dpkg -l | grep postgres
remove all the above listed packages using the command :
- apt-get --purge remove package1 package2 ..
Confirm all the files and folders related to postgres/postgresql are deleted using the command :
- whereis postgres
- whereis postgresql
Remove all the files and folders listed using rm command.
Delete the user postgres using the command :
- userdel -f postgres
happy coding :)
New contributor
add a comment |
up vote
0
down vote
Follow the commands:
- sudo apt-get --purge remove postgresql
List all postgres related packages:
- dpkg -l | grep postgres
remove all the above listed packages using the command :
- apt-get --purge remove package1 package2 ..
Confirm all the files and folders related to postgres/postgresql are deleted using the command :
- whereis postgres
- whereis postgresql
Remove all the files and folders listed using rm command.
Delete the user postgres using the command :
- userdel -f postgres
happy coding :)
New contributor
add a comment |
up vote
0
down vote
up vote
0
down vote
Follow the commands:
- sudo apt-get --purge remove postgresql
List all postgres related packages:
- dpkg -l | grep postgres
remove all the above listed packages using the command :
- apt-get --purge remove package1 package2 ..
Confirm all the files and folders related to postgres/postgresql are deleted using the command :
- whereis postgres
- whereis postgresql
Remove all the files and folders listed using rm command.
Delete the user postgres using the command :
- userdel -f postgres
happy coding :)
New contributor
Follow the commands:
- sudo apt-get --purge remove postgresql
List all postgres related packages:
- dpkg -l | grep postgres
remove all the above listed packages using the command :
- apt-get --purge remove package1 package2 ..
Confirm all the files and folders related to postgres/postgresql are deleted using the command :
- whereis postgres
- whereis postgresql
Remove all the files and folders listed using rm command.
Delete the user postgres using the command :
- userdel -f postgres
happy coding :)
New contributor
New contributor
answered Dec 4 at 4:10
T.Tijo
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f32730%2fhow-to-remove-postgres-from-my-installation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown