Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to fix an APT setup in an Ubuntu server to which I only have SSH access and can't make head or tail of the dependency errors.

I've run sudo apt-get install -f, and get the following:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up ssl-cert (1.0.23ubuntu2) ...
dpkg: error processing ssl-cert (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-common:
 postgresql-common depends on ssl-cert (>= 1.0.11); however:
  Package ssl-cert is not configured yet.
dpkg: error processing postgresql-common (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of postgresql-8.4:
 postgresql-8.4 depends on postgresql-common (>= 104~); however:
  Package postgresql-common is not configured yet.
 postgresql-8.4 depends on ssl-cert; however:
  Package ssl-cert is not configured yet.
dpkg: error processing postgresql-8.4 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-8.4; however:
  Package postgresql-8.4 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 ssl-cert
 postgresql-common
 postgresql-8.4
 postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)

What exactly does this mean? Is there a circular dependency?

I've tried installing the required dependency ssl-cert but it doesn't work either.

I can't use dpkg directly either.

Any tips on how to resolve this, or could someone help me to better understand the problem? Is there any additional information that I should provide?

===

EDIT:
Running sudo sh -x /path/to/config.postinst configure yields the following output:

+ . /usr/share/debconf/confmodule
+ [ !  ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [  ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/ssl-cert.postinst configure

Does that mean that the script fails to execute the last line?

Running sudo /usr/share/debconf/frontend /var/lib/dpkg/info/ssl-cert.postinst configure completes silently but a subsequent echo $? yields 1, indicating that an error did occur.

When I add set -x to the top of the file, and then run the sudo ... frontend ... configure command, it fails at:

make-ssl-cert generate-default-snakeoil

set -xing this file as well fails at:

 openssl req -config /tmp/tmp.wPl6nkzKYm -new -x509 -days 3650 -nodes -out /etc/ssl/certs/ssl-cert-snakeoil.pem -keyout /etc/ssl/private/ssl-cert-snakeoil.key

Running this command with sudo gives:

Generating a 1024 bit RSA private key
.....................++++++
.......................++++++
writing new private key to '/etc/ssl/private/ssl-cert-snakeoil.key'
-----
problems making Certificate Request
53829:error:0D07A097:asn1 encoding routines:ASN1_mbstring_ncopy:string too long:a_mbstr.c:154:maxsize=64

I'm not familiar with OpenSSL; what's going on here?

(Also, should I fork this to a new question? Has this question's scope been exceeded?)

share|improve this question
    
you have to edit the file and add set -x at the start of ssl-cert.postinst. –  Braiam Sep 6 '13 at 16:58
    
Is your machines' FQDN very long? –  200_success Sep 6 '13 at 17:18
    
What's the output of hostname? –  Braiam Sep 6 '13 at 19:37
    
@Braiam: hostname outputs the correct hostname, which is an 11-character string according to both hostname | wc -c and my eyes. –  WChargin Sep 7 '13 at 1:31
add comment

migrated from unix.stackexchange.com Sep 6 '13 at 19:28

This question came from our site for users of Linux, FreeBSD and other Un*x-like operating systems..

2 Answers

up vote 2 down vote accepted

I went around for a bit, and seems that your "Company name" is too long for openSSL. This is a bug. You should upgrade your system to precise or later to fix this.

Remove any blocking package and upgrade your system. That should fix the issue.

share|improve this answer
    
This series of commands gives me the same error; there appears to be an error in the configuration. –  WChargin Sep 6 '13 at 16:54
    
@WChargin updated my answer. –  Braiam Sep 7 '13 at 1:41
    
Thanks for this; how can I find what my "company name" is? –  WChargin Sep 7 '13 at 3:08
    
Ah; found it! Thanks! This appears to solve (the first step of) the problem. (For anyone reading this later it's the argument to openssl after -config) –  WChargin Sep 7 '13 at 3:19
    
@WChargin precise don't have the 1.0.23ubuntu2 version of openssl, but 1.0.28. According to the package list you are using lucid. I strongly recommend to do a full upgrade of your system. –  Braiam Sep 7 '13 at 3:35
add comment

The key excerpt from the output is this error while running the post-installation script for the ssl-cert package:

Setting up ssl-cert (1.0.23ubuntu2) ...
dpkg: error processing ssl-cert (--configure):
subprocess installed post-installation script returned error exit status 1

All of the subsequent errors are a consequence of the failure to complete the installation of ssl-cert.

To find out exactly how the postinst script failed, run

sudo sh -x /var/lib/dpkg/info/ssl-cert.postinst configure

Once you manage to debug the root cause, run sudo apt-get install -f again.

share|improve this answer
    
Please see my edit. –  WChargin Sep 6 '13 at 16:53
    
As suggested in the link, edit ssl-cert.postinst, inserting set -x, and try running the postinst script again. –  200_success Sep 6 '13 at 17:00
add comment

Your Answer

 
discard

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.