Strange locale issue on arch

Tomasz Rakowski picture Tomasz Rakowski · Jan 31, 2015 · Viewed 9.3k times · Source

Recently my gnome-terminal stopped working. After starting it using xterm I saw the following:

(process:3975): Gtk-WARNING **: Locale not supported by C library.
    Using the fallback 'C' locale.
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8

It appears to be related to my locale which looks like this:

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
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.utf8
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=

My locale -a looks like this:

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
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8
fr_CA.utf8
pl_PL.utf8

I'm really not sure where all the en_GB.utf8 come from in the output of locale.

I tried locale-gen, as suggested in posts regarding similar issues, but that has not fixed the problem. How do I repair this ? Other accounts on this computer don't have this issue, only mine. I do not remember having done anything in particular that would have caused this.

Answer

tmp picture tmp · Mar 16, 2015

There are two ways of fixing the issue.

  1. Generate missing locale. Open /etc/locale.gen and uncomment the line with missing locale (en_GB.utf8). Then run locale-gen as root.
  2. Find where the locale is set to incorrect value. Try grep LANG ~/.*profile ~/.bashrc ~/.pam_environment ~/.xinitrc. Comment the line with erroneous export command.

To be sure, that changes are applied, relogin or reboot.