Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
The second part of your question (downgrading) is answered where you've asked it: – don.joey Apr 25 '13 at 9:45

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?

share|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.

share|improve this answer


sudo apt-get --purge remove postgresql
share|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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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