45

I was trying to install sendmail but it is hanging while trying to generate ssl certificates. I have canceled the installation process and later killed processes that was locking any new packages from installing.

But whenever I run apt-get install <package_name> it goes back to the sendmail installation and trys to install the ssl certs.

I have rebooted the system but problem is persisted.

How do I resolve this?

CLI Information

sudo dpkg --configure -a
Setting up sendmail-bin (8.15.2-3) ...
Updating sendmail environment ...
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Disabling HOST statistics file(/var/lib/sendmail/host_status).
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Writing configuration to /etc/mail/sendmail.conf.
Writing /etc/cron.d/sendmail.
Could not open /etc/mail/databases(No such file or directory), creating it.
Reading configuration from /etc/mail/sendmail.conf.
Validating configuration.
Creating /etc/mail/databases...

Checking filesystem, this may take some time - it will not hang!
  ...   Done.

Checking for installed MDAs...
sasl2-bin not installed, not configuring sendmail support.

To enable sendmail SASL2 support at a later date, invoke "/usr/share/sendmail/update_auth"


Creating/Updating SSL(for TLS) information
Creating /etc/mail/tls/starttls.m4...
Creating SSL certificates for sendmail.

A similar problem can be found here but there wasn't a solution. OP just changed the OS.

  • Hey, supporting information (I just experienced this) The sendmail installer script is providing the wrong arguments to openssl. Specifically this line is waiting for data from STDIN which the script is not supplying, and the -in parameter hasn't been provided. openssl dsaparam 2048 -out. I am not sure of the solution. Maybe submit a bug to the sendmail package maintainer? – Jotham Jul 20 '17 at 0:47
  • How do I get in touch with maintainer. I need to at least resolve this issue. I cam stuck more then 1 day now. I can't install other packages as well. – Sisir Jul 20 '17 at 6:05
98

I just experienced this problem also. It appears to hang on line 240 of this script /usr/share/sendmail/update_tls.

To solve the problem, I executed the following commands:

cd /etc/mail/tls
sudo openssl dsaparam -out sendmail-common.prm 2048
sudo chown root:smmsp sendmail-common.prm
sudo chmod 0640 sendmail-common.prm
sudo dpkg --configure -a

It should now install.

  • 16
    This worked, thanks. One side note: if dpkg is locked due to the hung install, you'll need to first to kill the update_sendmail pid. [ps -A | grep update_sendmail] before running dpkg --configure -a. – pragmar Aug 28 '17 at 19:01
  • 8
    After killing stuck dpkg processed and running dpkg --configure -a it now hangs on "Updating /etc/mail/aliases..." – Alex Shchur Oct 1 '17 at 19:23
  • 5
    oh wait, it actually now is fine. It just took a while to do it's things – Alex Shchur Oct 1 '17 at 19:23
  • 4
    Suitable for Ubuntu 14.04 also – Lavi Avigdor Oct 7 '17 at 21:59
  • 4
    I got this error :Warning: 3 database(s) sources were not found, (but were created) please investigate. should I be worried? – user10089632 Mar 13 '18 at 17:34

protected by Community Sep 25 '18 at 1:02

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.