How to completly remove postgresql from Ubuntu 13.04?

You can remove PostgreSQL completely by running the following commands:

sudo apt-get purge 'postgresql-*'
sudo apt-get autoremove 'postgresql-*'

apt-get --purge remove postgresql-common

With dpkg --info <packagename> you can see, which is required by this current package. In most cases, there is a simple package, which is needed by all. This can be removed with apt.


psql is from postgresql-client package. So - remove it using the full name of the package:

apt-get remove postgresql-client-9.1