Saving the planet, one website at a time

Hi, I'm th3james. I build stuff with Coffeescript, Clientside MVC and Rails

Fixing Locale Issues Over SSH After Zsh Upgrade

I recently upgraded to the rather nice OhMyZsh, which I was enjoying, until SSH’ed to one of our Ubuntu servers, tabbed to auto complete, and was presented with this message:

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

… each and every time I tabbed. Needless to say, this gets pretty annoying fast.

I tried a few solutions on the internet, before stumbling across this post which pointed me towards /var/lib/locales/supported.d/local.

To fix the issue, you need to add a line to that file for the locale that bash is complaining about:

en_GB ISO-8859-1
en_GB.UTF-8 UTF-8

Since UTF should be the same for each locale, we just point en_GB.UTF to UTF-8 (this is probably the same as the default locale your system has).

Once you’ve done that:

sudo dpkg-reconfigure locales

Login/logout and enjoy working tab completion again.