Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] dpkg Errors after Executing the Hardening Script #296

Closed
r0bc94 opened this issue Jun 28, 2023 · 2 comments
Closed

[BUG] dpkg Errors after Executing the Hardening Script #296

r0bc94 opened this issue Jun 28, 2023 · 2 comments
Assignees

Comments

@r0bc94
Copy link

r0bc94 commented Jun 28, 2023

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.

@konstruktoid
Copy link
Owner

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

@r0bc94
Copy link
Author

r0bc94 commented 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

@r0bc94 r0bc94 closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants