I'm getting some strange errors lately whenever trying to apt-get install anything. Here's an example from trying to install fluidsynth.

$ sudo apt-get install libfluidsynth1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libfluidsynth1 is already the newest version.
libfluidsynth1 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up postgresql-9.1 (9.1.10-0ubuntu12.04) ...
 * Starting PostgreSQL 9.1 database server                                                                                                                     * The PostgreSQL server failed to start. Please check the log output:
2013-11-03 14:21:42 EST FATAL:  could not access private key file "server.key": No such file or directory
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-9.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.1; however:
  Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm running 12.04. What's causing this and how do I address it? It happens for installing lots of things, and seems to suggest I need to initialize postgresql or something. I don't recall having fiddled with postgres, so I'm not sure why this suddenly became problematic.

2 Answers 2


Remove/purge postgresql-9.1 and reinstall them:

sudo apt-get --purge autoremove postgresql-9.1 postgresql

If you really use postgresql, or another package depends of it, you can install it again

sudo apt-get install postgresql the-other-program-that-got-removed

BTW, libfluidsynth1 is already installed, you don't need to install it again.

  • (Reading database ... 1024332 files and directories currently installed.) Removing postgresql ... Removing postgresql-9.1 ... * Stopping PostgreSQL 9.1 database server [ OK ] Purging configuration files for postgresql-9.1 ... Dropping cluster main... dpkg: warning: while removing postgresql-9.1, directory '/usr/lib/postgresql/9.1/lib' not empty so not removed. Nov 4, 2013 at 2:41
  • I don't see any problem there? What is the problem? You need /usr/lib/postgresql/9.1/lib empty. Just run sudo rm /usr/lib/postgresql/9.1/lib/*
    – Braiam
    Nov 4, 2013 at 2:56

There's an even easier solution: Postgresql requires the "snakeoil" certificate to exist in order to run: /etc/ssl/private/ssl-cert-snakeoil.key If this was somehow deleted from your system, you can generate a new one with

# make-ssl-cert generate-default-snakeoil

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.