[GH-ISSUE #296] [BUG] dpkg Errors after Executing the Hardening Script #77

Closed
opened 2026-03-03 13:58:57 +03:00 by kerem · 2 comments
Owner

Originally created by @r0bc94 on GitHub (Jun 28, 2023).
Original GitHub issue: https://github.com/konstruktoid/hardening/issues/296

Originally assigned to: @konstruktoid on GitHub.

Describe the bug
After running the script as mentioned in the readme file, dpkg fails with the following error message each time, apt is executed:

Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 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.4.13-0ubuntu1.2) ...

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: numeric hostname: 10.10.191.254
newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 10.10.191.254
dpkg: error processing package postfix (--configure):
 installed postfix package post-installation script subprocess returned error exit status 75
dpkg: dependency problems prevent configuration of psad:
 psad 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 psad (--configure):
 dependency problems - leaving unconfigured
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
dpkg: dependency problems prevent configuration of aide-common:
 aide-common 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 aide-common (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Errors were encountered while processing:
 postfix
 psad
 bsd-mailx
 aide-common
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 178 files, found 135
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

This messages where also seen while the hardening script was running.

To Reproduce

  1. Run Hardening script as mentioned in the readme
  2. Run some operation with apt , for example apt upgrade

Expected behavior
A clean dpkg/apt state.

System (lsb_release -a):

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

This also happens on 22.04 lts

Additional Context
The configuration was left untouched, only the CHANGEME parameter was changed.

Originally created by @r0bc94 on GitHub (Jun 28, 2023). Original GitHub issue: https://github.com/konstruktoid/hardening/issues/296 Originally assigned to: @konstruktoid on GitHub. **Describe the bug** After running the script as mentioned in the readme file, dpkg fails with the following error message each time, `apt` is executed: ``` Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 4 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.4.13-0ubuntu1.2) ... 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: numeric hostname: 10.10.191.254 newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 10.10.191.254 dpkg: error processing package postfix (--configure): installed postfix package post-installation script subprocess returned error exit status 75 dpkg: dependency problems prevent configuration of psad: psad 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 psad (--configure): dependency problems - leaving unconfigured 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 dpkg: dependency problems prevent configuration of aide-common: aide-common 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 aide-common (--configure): dependency problems - leaving unconfigured Processing triggers for libc-bin (2.31-0ubuntu9.9) ... Errors were encountered while processing: postfix psad bsd-mailx aide-common [ Rootkit Hunter version 1.4.6 ] File updated: searched for 178 files, found 135 needrestart is being skipped since dpkg has failed E: Sub-process /usr/bin/dpkg returned an error code (1) ``` This messages where also seen while the hardening script was running. **To Reproduce** 1. Run Hardening script as mentioned in the readme 2. Run some operation with `apt` , for example `apt upgrade` **Expected behavior** A clean dpkg/apt state. **System (lsb_release -a):** ``` No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal ``` This also happens on 22.04 lts **Additional Context** The configuration was left untouched, only the `CHANGEME` parameter was changed.
kerem closed this issue 2026-03-03 13:58:57 +03:00
Author
Owner

@konstruktoid commented on GitHub (Jun 28, 2023):

This breaks postfix and leaves it all in a messy state:

newaliases: warning: valid_hostname: numeric hostname: 10.10.191.254
newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 10.10.191.254
<!-- gh-comment-id:1611356206 --> @konstruktoid commented on GitHub (Jun 28, 2023): This breaks postfix and leaves it all in a messy state: ``` newaliases: warning: valid_hostname: numeric hostname: 10.10.191.254 newaliases: fatal: file /etc/postfix/main.cf: parameter mydomain: bad parameter value: 10.10.191.254 ```
Author
Owner

@r0bc94 commented on GitHub (Jun 29, 2023):

Hi,
thank you for this fast update. It seems that fixing the issue in the /etc/postfix/main.cf file and reconfiguring the packages using dpkg did resolve this problem. Basically, the issue and solution is documented here: https://askubuntu.com/questions/691903/error-during-running-newaliases

<!-- gh-comment-id:1612760347 --> @r0bc94 commented on GitHub (Jun 29, 2023): Hi, thank you for this fast update. It seems that fixing the issue in the `/etc/postfix/main.cf` file and reconfiguring the packages using dpkg did resolve this problem. Basically, the issue and solution is documented here: https://askubuntu.com/questions/691903/error-during-running-newaliases
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hardening#77
No description provided.