29

When I press tab for autocompletion I get this error:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)

I've tried running this:

locale-gen en_US en_US.UTF-8
dpkg-reconfigure locales
reboot

But it doesn't help. Do you know what is missing?

I'm running Ubuntu 13.04.

closed as off-topic by karel, Eric Carvalho, Florian Diesch, mikewhatever, Lucio Feb 1 '14 at 23:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

49

Fixed it by adding these lines to ~/.bash_profile on my local machine (OSX).

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
  • 2
    Actually, setting both LANG and LC_ALL makes little sense. And you should really take a look at /etc/default/locale to fix the issue system-wide. – Gunnar Hjalmarsson Jan 30 '14 at 12:17
  • 1
    @GunnarHjalmarsson On the server it's LANG=en_US.UTF-8. That file doesn't exist on OSX. – Znarkus Jan 30 '14 at 13:23
  • 1
    Missed that you connect remotely. So apparently your local locale settings are exported to the server. In any case, given that LANG is used on the server, setting LANG in ~/.bash_profile ought to be sufficient. help.ubuntu.com/community/… describes the various locale categories. – Gunnar Hjalmarsson Jan 30 '14 at 16:40
  • I experienced the same problem (locale warning on tab for auto-complete) on remote sessions from OS X to Ubuntu. This answer worked for me as well. – Carl Oct 7 '16 at 21:51
4

You may have some odd setting in /etc/default/locale. "UTF-8" is not a complete locale name.

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