gnome-terminal doesn't work maybe because of locale setting
Asked Answered
U

5

7

I installed Antergos (easy version of Arch) with the Japanese environment. But I wanted to chaned the language to English, so I reffer the wiki article then run some commands after uncomment #en_US.UTF-8 UTF-8 in /etc/locale.gen and edit /etc/locale.conf into following:

LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

The problem starts from here.

I restarted my computer and found that gnome-terminal doesn't work. I substituted eshell on Emacs and run gnome-terminal command, then got error messages:

(process:1202): 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

The output of locale command is following:

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=ja_JP.utf8
LC_TIME=ja_JP.utf8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=ja_JP.utf8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=ja_JP.utf8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=ja_JP.utf8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

What changes some part of locale setting into Japanese? Or other reasons which terminate gnome-terminal exist?

I have tried solutions sugestted here https://bbs.archlinux.org/viewtopic.php?id=180103 .

Thank you.

Ulaulah answered 14/7, 2014 at 11:23 Comment(0)
M
12

I had the same problem some time ago. I fixed my locale config running this command

sudo localedef -f UTF-8 -i en_US en_US.UTF-8
Micamicaela answered 23/1, 2017 at 16:8 Comment(3)
Thank you so much! I was getting Error code 9, And this fixed it. Thanks!Conciseness
saved my day. could not get access to my terminal because of this error.Cyprinid
Great!!! After upgrading my glibc, the terminal ui cannot work. Fixed it by this command.Greenheart
N
1

The meaning of status code 8 is documented on gnome's website here:

The environment that gnome-terminal-server is started with does not correctly set the locale to a UTF-8 locale. Consult your distribution's documentation on how to fix this. Note that is it not relevant to check the locale settings from a different terminal (e.g. xterm); what counts is the environment that the session dbus-daemon passes to the processes it starts.

So you're right, this is probably due to locale settings. I don't quite understand all the details, but if I set ~/.xinitrc to exec gnome-session and then run startx, I get a similar error to yours.

However, if instead of running startx, I start the gdm display manager (via systemctl start gdm.service on Arch), I can spawn a gnome-terminal correctly. So if you're okay with using gdm, that may be a solution. Lightdm also works, though SLiM doesn't (from my experience).

In the past, I also had to install the vte3 package for gnome-terminal to work, so make sure that's installed as well. And FWIW, sudo gnome-terminal seems to always work.

Nolin answered 20/10, 2015 at 9:42 Comment(0)
V
0

Did you think to regenerate your locales after you had edited your /etc/locale.gen file ?

locale-gen

I think in your explanation you mixed the /etc/locale.gen and the /etc/locale.conf files. Be sure you edited the correct file with the correct values.

Vietnamese answered 16/7, 2014 at 21:38 Comment(1)
Sorry, I've mistaken them in question. They are correct on the computer.Ulaulah
C
0

Ok this is how I solved it; sudo locale-gen --purge --no-archive

Then; sudo update-initramfs -u

Chon answered 6/1, 2020 at 7:12 Comment(0)
D
0

Nothing with locale worked for me. Once changed back the default python version (3.5 on ubuntu16), terminal worked just fine.

Diastyle answered 22/11, 2020 at 15:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.