Changing Hostname

Hey Y’all,

I’m attempting to change my hostname from “mailserver.MYDOMAIN.com” to “mail.MYDOMAIN.com”. From what I gathered on Google, simply running “sudo mailinabox” should’ve been enough. However when I run that command, I get the following error:

Updating system packages…

FAILED: apt-get -y -o Dpkg::Options::=–force-confdef -o Dpkg::Options::=–force-confnew upgrade

Reading package lists…
Building dependency tree…
Reading state information…
You might want to run ‘apt-get -f install’ to correct these.
The following packages have unmet dependencies:
libpython-stdlib : Depends: libpython2.7-stdlib (>= 2.7.15~rc1-1~) but 2.7.6-8ubuntu0.4 is installed
libpython2.7-stdlib : Depends: libpython2.7-minimal (= 2.7.6-8ubuntu0.4) but 2.7.15~rc1-1 is installed
python : Depends: python2.7 (>= 2.7.15~rc1-1~) but 2.7.6-8ubuntu0.4 is installed
python2.7 : Depends: python2.7-minimal (= 2.7.6-8ubuntu0.4) but 2.7.15~rc1-1 is installed
E: Unmet dependencies. Try using -f.

How should I proceed here?

One additional question – will changing my hostname invalidate the DKIM keys that were generated?

Have you done normal Ubuntu maintenance on your server?

Nope, not enough … assuming that you are installing as per the instructions (i.e. no external DNS, etc.) you also need to modify your glue records with your domain registrar.