Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting rather annoyed with Ubuntu 13.10. I need to go about fixing locales on my server, or else I see junk like this happening:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Most fixes online state that adding

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

to .bashrc and .bash_login should fix the problem.

Some mention that running the following from the commands:

$ sudo locale-gen en_US en_US.UTF-8
$ dpkg-reconfigure locales

should also help. I also tried rebooting the server on top of all the above.

It seems to work for when I'm SSH'ed into that server via terminal, but when I run remote deployment scripts from capistrano, I still get the Perl errors in my output.

I thought that's exactly what the exports in .bash_login should have fixed.

I even tried running

apt-get install language-pack-en-base

Nothing works!

share|improve this question

A couple of notes:

  • System wide locale settings are stored in /etc/default/locale.
  • It makes no sense to set all of LC_ALL, LC_CTYPE and LANG.

A cleaner solution is to let /etc/default/locale contain only


and drop those entries in /etc/bash.bashrc.

share|improve this answer
+1 this worked for me! – user01 Feb 26 '14 at 14:13
what do you mean, drop those entries in /etc/bash.bashrc? – user44516 May 27 '14 at 3:30
@user44516: I mean the lines as described in the answer of josef.van.niekerk. – Gunnar Hjalmarsson May 27 '14 at 9:33

I added the

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

snippet to /etc/bash.bashrc instead and that fixed the problem.

I doubt the call to locale-gen, dpkg-reconfigure and installing language-pack-en-base was necessary at all.

share|improve this answer

I executed locale-gen en_US.UTF-8 as root and it worked great.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.