Announcement

Collapse
No announcement yet.

dpkg: error processing package bsd-mailx [--configure]:

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    dpkg: error processing package bsd-mailx [--configure]:

    I recently install 16.04. In the past couple of days when I try to do a requested upgrade (from the Konsole) I get the following error message:

    larry1604@larry1604:~$ sudo apt-get upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 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 postfix (3.1.0-3) ...

    Postfix configuration was not changed. If you need to make changes, edit
    /etc/postfix/main.cf (and others) as needed. To view Postfix configuration
    values, see postconf(1).

    After modifying main.cf, be sure to run '/etc/init.d/postfix reload'.

    Running newaliases
    newaliases: warning: valid_hostname: numeric hostname: 1
    newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 1
    dpkg: error processing package postfix (--configure):
    subprocess installed post-installation script returned error exit status 75
    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 configured yet.
    Package mail-transport-agent is not installed.
    Package postfix which provides mail-transport-agent is not configured yet.

    dpkg: error processing package bsd-mailx (--configure):
    dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
    Processing triggers for libc-bin (2.23-0ubuntu4) ...
    Errors were encountered while processing:
    postfix
    bsd-mailx
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    larry1604@larry1604:~$

    How do I fix this?

    #2
    As the message says, you have error in file /etc/postfix/main.cf
    Just open it and search for "mydomain" in there.

    There should be a comment in that file that explains mydomain option. Often it does not even have to be set as it gets detected based on hostname.

    Comment


      #3
      Are you updating the package cache before you run the upgrade (sudo apt-get update)? Also, you will have better overall results with package management if you use dist-upgrade instead of upgrade (sudo apt-get dist-upgrade).
      Windows no longer obstructs my view.
      Using Kubuntu Linux since March 23, 2007.
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        I am using upgrade after I run update. Given Snowhog's suggestion and a bit of reading I will switch to dist-upgrade. On the original problem. In main.cf there is no listing of the " mydomain" parameter. i.e.:

        See /usr/share/postfix/main.cf.dist for a commented, more complete version


        # Debian specific: Specifying a file name will cause the first
        # line of that file to be used as the name. The Debian default
        # is /etc/mailname.
        #myorigin = /etc/mailname

        smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
        biff = no

        # appending .domain is the MUA's job.
        append_dot_mydomain = no

        # Uncomment the next line to generate "delayed mail" warnings
        #delay_warning_time = 4h

        readme_directory = no

        # TLS parameters
        smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
        smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
        smtpd_use_tls=yes
        smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
        smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

        # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
        # information on enabling SSL in the smtp client.

        smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
        myhostname = larry1604.1
        alias_maps = hash:/etc/aliases
        alias_database = hash:/etc/aliases
        myorigin = /etc/mailname
        mydestination = $myhostname, larry1604.1, localhost.1, , localhost
        relayhost =
        mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
        mailbox_command = procmail -a "$EXTENSION"
        mailbox_size_limit = 0
        recipient_delimiter = +
        inet_interfaces = all
        inet_protocols = all

        So I looked at "main.cf.dist" and "mydomain" talked about a bit but only in lines that are commented out and not about my error message in particular. So given my error output I ran "postconf". And indeed mydomain =1. What file I would change this in and to what value is not at all clear to me.

        Comment


          #5
          What is host name on that machine?
          Can you run these two:

          hostname

          grep `hostname` /etc/hosts
          note those are backticks - not quotes

          If your hostname is larry1604.1, that would mess things up. In /etc/hostname host name should be just name, like "larry1604" and then in /etc/hosts you should have something like "127.0.0.1 larry1604 larry1604.example.com"

          In RH world, they just put full FQDN in /etc/hostname which also works fine.

          postfix gets hostname value as "hostname -f", which returns full FQDN (larry1604.example.com in this example), and then it takes part after the first dot and uses it as "mydomain" (example.com in this example).
          Last edited by sasha; Nov 02, 2016, 06:24 PM.

          Comment


            #6
            hostname gives me larry1604
            grep `hostname` /etc/hosts gives me 127.0.1.1 larry1604.1 larry1604

            Comment


              #7
              that entry, larry1604.1, in /etc/hosts is your problem.

              If you have no real domain, it should be just
              127.0.1.1 larry1604

              Comment


                #8
                OK so here is the contents of the file:

                127.0.0.1 localhost
                127.0.1.1 larry1604.1 larry1604

                # The following lines are desirable for IPv6 capable hosts
                ::1 ip6-localhost ip6-loopback
                fe00::0 ip6-localnet
                ff00::0 ip6-mcastprefix
                ff02::1 ip6-allnodes
                ff02::2 ip6-allrouters


                What does it mean "if I have no real domain". Sorry but I'm out of my depth here.
                What should I do to fix the problem?

                Comment


                  #9
                  Change
                  127.0.1.1 larry1604.1 larry1604
                  To
                  127.0.1.1 larry1604

                  Comment


                    #10
                    Now the first two lines of the file read:

                    127.0.0.1 localhost
                    127.0.1.1 larry1604

                    I rebooted, the changes to the file were still there. So is the error message about postfix configuration is not changed, when I run dist-upgrade. And running postconf shows that still mydomain=1

                    Comment


                      #11
                      So, there in no mention of larry1604.1 in /etc/hosts and more and the only thing in /etc/hostname is larry1604, correct?

                      Also, i noticed you have this in main.cf:
                      myhostname = larry1604.1

                      If that is still there, comment it out.

                      Comment


                        #12
                        Correct there is no mention of larry1604.1 in /etc/hosts and the only thing in /etc/hostname is larry1604.

                        I commented out myhostname = larry1604.1 Then I ran /etc/init.d/postfix reload Then I ran apt-get dist-upgrade and I did not get the error message. However I still have a few concerns. In the original error message I got:

                        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 configured yet.
                        Package mail-transport-agent is not installed.
                        Package postfix which provides mail-transport-agent is not configured yet.

                        dpkg: error processing package bsd-mailx (--configure):
                        dependency problems - leaving unconfigured
                        No apport report written because the error message indicates its a followup error from a previous failure.
                        Processing triggers for libc-bin (2.23-0ubuntu4) ...
                        Errors were encountered while processing:
                        postfix
                        bsd-mailx
                        E: Sub-process /usr/bin/dpkg returned an error code (1)

                        So are those problems now automatically resolved or do I need to do something else?

                        Second, I noticed there is a line in main.cf "mkdestination = $myhostname, larry1604.1, localhost.1, localhost
                        Is that a problem?

                        Lastly in the error message are the lines:

                        bsd-mailx depends on default-mta | mail-transport-agent; however:
                        Package default-mta is not installed.
                        Package postfix which provides default-mta is not configured yet.
                        Package mail-transport-agent is not installed.
                        Package postfix which provides mail-transport-agent is not configured yet.

                        Is that relevant to the fact that I'm having trouble getting Kmail to download mail? Or is that the topic for another discussion and not this one?

                        Comment


                          #13
                          You were doing upgrade of many packages, and some of them depend on mail server (postfix). Postfix install (post install) failed, so all other packages were not updated. Once you fixed the error and run upgrade again, they all got upgraded if there were not errors. Your postfix is still missconfigured, but it should not hurt you. It definitely has nothing with you not receiving email.

                          Comment


                            #14
                            Thank you for all of your help.

                            Comment

                            Working...
                            X