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

When I wanna do anything with Synaptic or apt-get or stop,start,restart postgresql I receive following error

Setting up postgresql-common (114) ...
 * Starting PostgreSQL 8.4 database server                                       * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 63.
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm using ubuntu 11.04 . I canceled upgrade to 11.10 last night during upgrade,and changed source.list, then reload package information from Synaptic. Maybe this is related to the issue in some way, however, I changed source.list back to default and reload it again, but, it doesn't solve my problem.

share|improve this question
how far through the upgrade did you cancel? 1% 50% 99%? – fossfreedom Jan 2 '12 at 11:11
@fossfreedom during downloading package,when it downloaded 21 packages of 2762 packages. – Moein7tl Jan 2 '12 at 11:16
up vote 2 down vote accepted

This is caused due to installation of Postgre SQL was stopped in between. Purge the postgre sql installation and you will be fine.

To purge postgre sql installation, in console type

sudo apt-get remove --purge postgresql

Trying running these commands, it should resolve it.

sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update && sudo apt-get upgrade
share|improve this answer
it failed,it returned same error during remove – Moein7tl Jan 2 '12 at 11:46
try doing sudo apt-get -f install – Rajesh Pantula Jan 2 '12 at 12:08
I did it too,but it will return same problem – Moein7tl Jan 2 '12 at 12:20


apt-get --purge remove postgresql\*

It helped me. I had same problem. Command differs with suggestion at the end '\*'.

share|improve this answer
Thanks, that worked for me – David Apr 5 '13 at 13:47

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.