Locale is missing, how to create it

when you get an error like this (seems to happen on all my fresh ubuntu installs)

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

you need to simply generate the missing locae by runningn

locale-gen "de_CH.UTF-8"

problem solved ;)

CentOS / RedHat solution

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8