Failure to generate default DKIM keys - perl: warning: Setting locale failed

Hi, trying to generate DKIM keys

I try in cyberpanel and it says generated “successfully” but I get a mail reporting:

[12.01.2022_08-23-09] We had errors while creating DKIM record for: Error message: Command '[‘cat’, ‘/etc/opendkim/keys/’]’ returned non-zero exit status 1…

I’ve also tried in SSH with > opendkim-default-keygen

I get the error message:

Generating default DKIM keys: perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),


LANG = (unset)

are supported and installed on your system.

perl: warning: Falling back to the standard locale (“C”).

Default DKIM keys for created in /etc/opendkim/keys.

I’m out of my depth here and in need of having a resolution spoon fed. Would greatly appreciate the help!

Hello @Rofocale Happy you are here

Seems to be locale issue. Have you tried to regenerate your locales and reconfigure them?

Hi, @josephgodwinke

I wouldn’t begin to know how to that! I did find a question that said to do the following:

export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

I then ran >opendkim-default-keygen

It gave me the error >Default DKIM keys already exist!

I’ve tried re-running the DKIM manager in cyberpanel OS, but I just get the same errors mail sent.

I’ve also tried DKIM Inspector - dmarcian and it comes back with “missing DKIM file”

I’m using DKIM selector “default” as that is what appears when Is end a mail to myself.

I am totally lost

RUn locale to list all existing locale settings

Hi, I’ve mangled to configure to en_US.UTF-8. But then the below occurs:

DO you have keys here /etc/opendkim/keys

Hi, I think the issue is something more fundamental. I’ve opened up another thread as it requires elaboration. I’m honestly thinking I might just delete everything and start again.