Locale warnings everywhere!


Have you ever seen this warning?

bsdtar: Failed to set default locale

Or those?

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:

Or even those?

svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_CTYPE is es_ES.UTF-8
svn: warning: please check that your locale name is correct

All those warnings means the same. If you google for them, you probably will end into the Arch forum, inside one of the many post regarding that annoying problem. And where everyone says the same, check your /etc/locale.gen and regenerate them with
# locale-gen

But when you double, even triple check everything and the same occurs again and again, it’s time to discard those solutions.

The easiest way to determine wich locale environment variables are missing, you must type:
# locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory

In this example, both LC_CTYPE and LC_MESSAGES are missing, but could be more, even LC_ALL, which was my case. The solution is to include them into ~/.basrc or if you want to the same system-wide, you should edit instead /etc/bash.bashrc and add every locale your system cannot found.

# /etc/bash.bashrc
export LANG=es_ES.UTF-8
export LC_MESSAGES="C"
export LC_ALL=es_ES.UTF-8

Close your session, your terminal or reboot. Your warnings should disappear after this!

2 thoughts on “Locale warnings everywhere!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s