Skip to content

Fixing perl errors when using gitolite + ssh + custom locales

If you have locale issues on a server, and your server is english only, this kind of issues can happen:

$ git push origin master
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_MESSAGES = "fr_FR.UTF-8",
	LC_COLLATE = "fr_FR.UTF-8",
	LC_CTYPE = "fr_FR.UTF-8",
	LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Everything up-to-date

You might want to check your /etc/ssh/sshd_config and look at the AcceptEnv token.
On this ssh server, it was:

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

My locale environment was passed to the server, but the server doesn’t know about fr. Since i don’t want to install fr locales, just comment that line:

# Allow client to pass locale environment variables
# AcceptEnv LANG LC_*

Done.