I have Postgresql 9.1.1 in my Ubuntu 12.04 which got installed due to automatic upgrades and whenever I uninstall it using the command:

sudo apt-get --purge remove postgresql-9.1.1

I get an error saying:

E: Unable to locate package postgresql-9.1.1
E: Couldn't find any package by regex 'postgresql-9.1.1

Can somebody tell me how to uninstall this package completely so that I can install the other lower version - 8.4.7


The version 9.1.1 of PostgerSQL is located in the package postgresql-9.1. So you should remove this package:

sudo apt-get purge postgresql-9.1

The second part of your question is already answered here: How do I downgrade PostgreSQL?

| improve this answer | |

If you want to uninstall postgresql and any related package, you should use autoremove:

sudo apt-get --purge autoremove postgresql*

This will select any package starting with postgresql and remove any automatic dependency that these packages installed efectivelly removing any version of postgresql. If you only want to remove the client or the server, your bet should be on apt-cache search postgresql | grep client or server.

| improve this answer | |


sudo apt-get --purge remove postgresql-9.1

Also you can install 8.4.7 and stop the server postgresql-9.1.

| improve this answer | |


sudo apt-get --purge remove postgresql
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.