1

I have upgraded from Ubuntu 20.10 to 21.04 and now when I run:

sudo apt update
sudo apt-get upgrade

I get this error below related to PostFix.

How can I solve this problem?

Hit:1 http://archive.ubuntu.com/ubuntu hirsute InRelease
Hit:2 http://archive.ubuntu.com/ubuntu hirsute-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu hirsute-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu hirsute-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  gcc-10-base:i386 gnome-shell-extension-desktop-icons libaom0:i386 libaribb24-0:i386 libasync-mergepoint-perl libavcodec-extra58:i386 libavutil56:i386
  libboost-date-time1.71.0 libboost-filesystem1.71.0 libboost-iostreams1.71.0 libboost-locale1.71.0 libboost-python1.71.0 libbrlapi0.7 libcodec2-0.9:i386
  libdav1d4:i386 libfuture-perl libgdk-pixbuf-xlib-2.0-0:i386 libgdk-pixbuf2.0-0:i386 libgomp1:i386 libio-async-loop-epoll-perl libio-async-perl libisl22 libjs-sizzle
  libjuh-java libjurt-java liblibreoffice-java liblinux-epoll-perl libmetrics-any-perl libmp3lame0:i386 libmysqlclient21 libmysqlclient21:i386 libnuma1:i386
  libopencore-amrnb0:i386 libopencore-amrwb0:i386 liborcus-0.15-0 liborcus-parser-0.15-0 libperl5.30 libperl5.30:i386 libpgm-5.2-0 libpodofo0.9.6 libpoppler102
  libpoppler102:i386 libpython3.8-dev libraw19 libre2-8 libreadline5 libridl-java libsereal-perl libshine3:i386 libsnappy1v5:i386 libsnmp35 libsnmp35:i386
  libsoxr0:i386 libspeex1:i386 libstd-rust-1.47 libstruct-dumb-perl libswresample3:i386 libtest-fatal-perl libtest-metrics-any-perl libtest-refcount-perl
  libtwolame0:i386 libunoloader-java libvdpau1:i386 libvo-amrwbenc0:i386 libvpx6:i386 libwavpack1:i386 libwebpmux3:i386 libx264-160:i386 libx265-192:i386
  libxml-writer-perl libxvidcore4:i386 libzvbi0:i386 linux-headers-5.8.0-49 linux-headers-5.8.0-49-generic linux-image-5.8.0-49-generic linux-modules-5.8.0-49-generic
  linux-modules-extra-5.8.0-49-generic mesa-vdpau-drivers:i386 mysql-common node-ansi-align node-arrify node-bl node-bluebird node-boxen node-builtin-modules
  node-call-limit node-camelcase node-ci-info node-cli-boxes node-cliui node-co node-concat-stream node-config-chain node-configstore node-cross-spawn
  node-crypto-random-string node-cyclist node-debbundle-es-to-primitive node-decamelize node-decompress-response node-deep-extend node-define-properties
  node-detect-indent node-detect-newline node-dot-prop node-duplexer3 node-duplexify node-editor node-end-of-stream node-errno node-es-abstract node-es6-promise
  node-execa node-find-up node-flush-write-stream node-from2 node-fs-vacuum node-genfun node-get-caller-file node-get-stream node-got node-has-symbol-support-x
  node-has-to-string-tag-x node-import-lazy node-invert-kv node-is-buffer node-is-npm node-is-obj node-is-object node-is-path-inside node-is-plain-obj
  node-is-retry-allowed node-is-stream node-isurl node-jquery node-json-buffer node-kind-of node-latest-version node-lazy-property node-lcid node-libnpx
  node-locate-path node-lodash node-lodash-packages node-lowercase-keys node-make-dir node-mem node-merge-stream node-mimic-fn node-mimic-response node-minimist
  node-mississippi node-npm-run-path node-object-inspect node-os-locale node-os-tmpdir node-p-cancelable node-p-finally node-p-is-promise node-p-limit node-p-locate
  node-p-timeout node-package-json node-parallel-transform node-path-exists node-path-is-inside node-pify node-prepend-http node-proto-list node-prr node-pseudomap
  node-pump node-pumpify node-qw node-rc node-registry-auth-token node-registry-url node-require-directory node-require-main-filename node-semver-diff node-sha
  node-shebang-command node-shebang-regex node-slide node-sorted-object node-stream-each node-stream-iterate node-stream-shift node-strict-uri-encode node-strip-eof
  node-strip-json-comments node-term-size node-through2 node-timed-out node-typedarray node-uid-number node-unique-string node-unpipe node-url-parse-lax
  node-url-to-options node-which-module node-widest-line node-wrap-ansi node-xdg-basedir node-xtend node-y18n node-yargs node-yargs-parser ocl-icd-libopencl1:i386
  perl-modules-5.30 python3.8 python3.8-dev python3.8-minimal python3.8-venv shim ure-java vdpau-driver-all:i386
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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.5.6-1) ...

Postfix (main.cf) 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 'systemctl reload postfix'.

Running newaliases
newaliases: warning: valid_hostname: misplaced delimiter: kubernetes-worker..
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: kubernetes-worker..
dpkg: error processing package postfix (--configure):
 installed postfix package post-installation script subprocess returned error exit status 75
Processing triggers for libc-bin (2.33-0ubuntu5) ...
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)
4
  • @Raffa's answer is suspect. See my comment to them, below.
    – heynnema
    Apr 25, 2021 at 14:21
  • @heynnema That is not true and the least I can say about your comment is misleading :) .... please see my reply below.
    – Raffa
    Apr 25, 2021 at 17:25
  • Edit your question and show me cat /etc/postfix/main.cf.old. Then grep -i alias /etc/postfix/main.cf.old and that will print something like "alias_database = hash:/etc/aliases", then show me cat /etc/aliases, and substituting your /path/filename. Start comments to me with @heynnema or I'll miss them.
    – heynnema
    Apr 25, 2021 at 19:39
  • I Have the same bug and have reported it on launchpad for ubuntu. Plz go to bugs.launchpad.net/ubuntu/+source/postfix/+bug/1931801 And write a post there so they can confirm that the bug exists for multiple users.
    – Darkyere
    Jun 16, 2021 at 16:08

2 Answers 2

3

The postfix main configuration file contains invalid entries.

You can edit it and fix wrong entries or you can back it up and create an empty configuration file like so:

sudo mv /etc/postfix/main.cf /etc/postfix/main.cf.old

Then run:

sudo touch /etc/postfix/main.cf

Then run:

sudo postfix reload

Please see this answer for more information on how to configure postfix.

5
  • Huh? This just creates a null main.cf, and thus removes any postfix configuration that the user has done, and breaks postfix. Am I missing something here?
    – heynnema
    Apr 25, 2021 at 14:16
  • @heynnema Your comment is misleading and you are missing / ignoring many things... 1. The configuration is backed up to /etc/postfix/main.cf.old 2. A link is provided to help the OP fix postfix configuration if they want, 3. Posfix configuration is already broken and not usable for OP. 4. The question is about enabling APT to update and upgrade and not about fixing postfix configuration that apparently is not in use and OP did not complain about postfix functionality but rather want to update their system using APT. It is what tho OP wants that matters... isn't it? :)
    – Raffa
    Apr 25, 2021 at 17:24
  • You can't assume that postfix was not in use in 20.10. Something in the 21.04 postfix update doesn't like "kubernetes-worker". If it was me, I would have asked to see their main.cf file, and the aliases database file. Your way just breaks postfix, whether the OP needs/wants it or not.
    – heynnema
    Apr 25, 2021 at 19:19
  • re: "what tho OP wants that matters... isn't it?" sometimes we have to help the OP understand what to ask for. OP said "I get this error below related to PostFix." and "How can I solve this problem?". OP needs a postfix solution, not an APT solution.
    – heynnema
    Apr 25, 2021 at 19:28
  • Dear @heynnema My answer provides two options... Please read in the answer You can edit it and fix wrong entries or you can back it up and create an empty configuration file ... and OP chose what serves them the best. ..... Please go ahead and post an answer to explain your point if there is any... It seems that you refuse to accept other solutions than what you have in mind. :)
    – Raffa
    Apr 25, 2021 at 19:34
0

I had this exact problem, on Ubuntu 21.04. Postfix wouldn't install properly, having never had the issue on 20.04:

newaliases: warning: valid_hostname: misplaced delimiter: RebuildAppV1
...
dpkg: error processing package postfix (--configure):
installed postfix package post-installation script subprocess returned error exit status 75
Processing triggers for libc-bin (2.33-0ubuntu5) ...
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

It turns out that Postfix install doesn't deal very well with your system hostname being set to anything other than a domain string eg. xxx.com

Even though I don't have a domain name (yet) for this server, all I had to do was change the hostname to "whatever.com" (after uninstalling and purging Postfix):

sudo hostnamectl set-hostname whatever.com 

Then, to check it's changed:

hostname -f

Then re-install Postfix.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .