Setting locale was not correct - missing package libencode-locale-perl was the root cause

Problem occured during upgrading after new set up dietpi system:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_TIME = "de_DE.UTF-8",
	LC_MONETARY = "de_DE.UTF-8",
	LC_ADDRESS = "de_DE.UTF-8",
	LC_TELEPHONE = "de_DE.UTF-8",
	LC_NAME = "de_DE.UTF-8",
	LC_MEASUREMENT = "de_DE.UTF-8",
	LC_IDENTIFICATION = "de_DE.UTF-8",
	LC_NUMERIC = "de_DE.UTF-8",
	LC_PAPER = "de_DE.UTF-8",
	LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_GB.UTF-8").

Tried to solve it by either

$ dietpi-config 
$ locale-gen "en_DE.UTF-8"
$ dpkg-reconfigure locales

What solves was installing the missing package

$ apt install libencode-locale-perl

Problem was gone!

Many thanks for reporting.

On which hardware/image did you face this? And did you try it on local console, SSH or serial console?

And did you test whether a reboot applies the locale change without having the package installed?

Thanks Micha!

I work on Pi 4b 2gb
I work via ssh in 99% of the cases
I set up with en.us-utf8 and German keyboard.
I did not remember whether I rebooted, but I guess not.

Do you use OpenSSH, and if so, can you show:

grep -r AcceptEnv /etc/ssh

It can allow the SSH client to pass a locale which may not be available at the server, throwing such errors then. But AFAIK we disable it :thinking:.