Score:1

Problems with ssmtp after upgrading to Ubuntu 20.04 LTS - package post-installation script subprocess returned error exit status 2

tr flag

may you can help me i facing this issue since i upgrade to ubuntu 20.04 LTS from 18.04 LTS. It seems that the script has problems to export value or information. I have no clue what todo. Thanks for any help!

Error:

Building dependency tree
Reading state information... Done
ssmtp is already the newest version (2.64-8.1ubuntu1).
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 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 ssmtp (2.64-8.1ubuntu1) ...
/var/lib/dpkg/info/ssmtp.config: 11: export: #enables: bad variable name
dpkg: error processing package ssmtp (--configure):
 installed ssmtp package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of bsd-mailx:
 bsd-mailx depends on default-mta | mail-transport-agent; however:
  Package default-mta is not installed.
  Package postfix which provides default-mta is not installed.
  Package mail-transport-agent is not installed.
  Package ssmtp which provides mail-transport-agent is not configured yet.
  Package postfix which provides mail-transport-agent is not installed.

dpkg: error processing package bsd-mailx (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apticron:
 apticron depends on bsd-mailx | mailx; however:
  Package bsd-mailx is not configured yet.
  Package mailx is not installed.
  Package bsd-mailx which provides mailx is not configured yet.

dpkg: error processing package apticron (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                                                                                                    Errors were encountered while processing:
 ssmtp
 bsd-mailx
 apticron
E: Sub-process /usr/bin/dpkg returned an error code (1)´´´
Score:1
tr flag

I could solve the problem by checking the ssmtp.config file under /etc/ssmtp/

There is a line with the FromLineOverride=YES parameter followed by a comment. This comment seems to be the problem. When i moved the comment a line up so that only the parameter i in a line the problem is solved.

Score:0
tr flag

Here is the output of /var/lib/dpkg/info/ssmtp.config:

#!/bin/sh set -e

. /usr/share/debconf/confmodule

if [ -f /etc/ssmtp/ssmtp.conf ] then for v in grep -E >"^(root|mailhub|rewriteDomain|hostname|FromLineOverride)=" /etc/ssmtp/ssmtp.conf do export $v done

  db_set ssmtp/root "$root"
  if [ -n "$mailhub" ]
  then
          if [ `expr index "$mailhub" :` -ne 0 ]
          then
                  db_set ssmtp/port "${mailhub#*:}"
                  db_set ssmtp/mailhub "${mailhub%:*}"
          else
                  db_set ssmtp/port 25
                  db_set ssmtp/mailhub "$mailhub"
          fi
   fi
  if [ -n "$rewriteDomain" ]
  then
          db_set ssmtp/rewritedomain "$rewriteDomain"
  fi
  if [ -n "$hostname" ]
  then
          db_set ssmtp/hostname "$hostname"
  fi
  if [ -n "$FromLineOverride" ]
  then
          if [ "$FromLineOverride" = "YES" ]
          then
                  db_set ssmtp/fromoverride true
          else
                  db_set ssmtp/fromoverride false
          fi
  fi

fi

db_input medium ssmtp/root || true db_go

db_input medium ssmtp/mailhub || true db_go

db_input low ssmtp/port || true db_go

db_input medium ssmtp/rewritedomain || true db_go

db_input low ssmtp/hostname || true db_go

db_input medium ssmtp/fromoverride || true db_go

Program End

exit 0

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.