0

I am trying to install postfix with the following command (Ubuntu 18.04.5 LTS):

apt-get install -y postfix

But I get the following bundle of errors:

Reading package lists...
Building dependency tree...
Reading state information...
postfix is already the newest version (3.3.0-1ubuntu0.3).
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.
Setting up postfix (3.3.0-1ubuntu0.3) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Adding system user `postfix' (UID 111) ...
Adding new user `postfix' (UID 111) with group `postfix' ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /var/spool/postfix -g postfix -s /usr/sbin/nologin -u 111 postfix' returned error code 1. Exiting.
dpkg: error processing package postfix (--configure):
 installed postfix package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Errors were encountered while processing:
 postfix
E: Sub-process /usr/bin/dpkg returned an error code (1)

To resolve this error I am trying to install the 'dialog' package:

sudo apt-get install dialog

But even that failed:

Reading package lists...
Building dependency tree...
Reading state information...
Package dialog is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'dialog' has no installation candidate

It is important for me to emphasize that 'apt update' did not solve the last problem either.

1 Answers1

0

Looks like you only need to setup environment variable TERM first for the dialog frontend to be usable.

If it doesn't fix it, you can install the following (small) package that solves the "can't find a dialog-like frontend" error when installing packages with apt :

apt install whiptail