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

I'm trying to uninstall postgresql, but its really complaining. I suspect something is broken. I'm on 12.04, installed via apt-get.

sudo apt-get remove postgresql


Reading package lists... Done Building dependency tree Reading state information... Done Package postgresql is not installed, so not removed 0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up postgresql-common (129ubuntu1) ... * Starting PostgreSQL 9.1 database server
* The PostgreSQL server failed to start. Please check the log output: 2013-07-12 11:13:30

BST FATAL: private key file "server.key" has group or world access 2013-07-12 11:13:30

BST DETAIL: File must be owned by the database user or root, must have no write permission for "group", and must have no permissions for "other".

invoke-rc.d: initscript postgresql, action "start" failed. dpkg: error processing postgresql-common (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of postgresql-9.1: postgresql-9.1 depends on postgresql-common (>= 115~); however: Package postgresql-common is not configured yet. dpkg: error processing postgresql-9.1 (--configure): dependency problems - leaving unconfigured

Now I have tried to fix the server.key file; I copied the snake oil file to /var/lib/postgresql/9.1/main/server.key then I have modded it:

chmod 700 server.key
chown postgres:postgres server.key

sanity check:

ls -l server.key

-rwx------ 1 postgres postgres 887 Jul 12 10:07 server.key

But it still complains that the file has group access.

Would appreciate any help to remove this, forced reinstall with install -f doesn't help. :(

share|improve this question

Fixed by purging the dependencies

apt-get purge postgresql-common
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.