Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

My system config is as follows:

System (running on Amazon EC2)

Ubuntu 10.04

Postgresql-8.2 installed and it is working.

ubuntu@ip:~$ sudo /etc/init.d/postgresql-8.2 status:
Running clusters: 8.2/main

When I try to shutdown the server, I get the error:

ubuntu@ip:~$ sudo /etc/init.d/postgresql-8.2 stop
* Stopping PostgreSQL 8.2 database server
* Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 63.                         [fail]

Because of the above problem I am unable to do a clean uninstall of PostgreSQL. Any suggestion on how to fix this problem?

I have tried the following:

sudo apt-get autoremove postgresql-8.2
sudo apt-get -f install
sudo apt-get purge postgresql-*

None of them resolved the problem.

Thanks in advance

share|improve this question
Check if… helps you solving the problem. – Andy Friese Dec 16 '12 at 11:59

Your Answer


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

Browse other questions tagged or ask your own question.