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

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.

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

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.

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.

Ok this is how I solved it;
sudo locale-gen --purge --no-archive
Then; sudo update-initramfs -u

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

Related

gnome-terminal-server: Locale not supported

I recently installed manjaro gnome and after configuring locale settings, I found out that the terminal does not show up due to this error (from journalctl -xe):
(process:2410): 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 1.
FIX:
So I went over internet and searched the error. I found out that it has something to do with /etc/locale.gen and /etc/locale.conf
It's actually on gnome's side and for whatever reasons related to their glib, they self-generated a corrupt locale.conf file and line "en_US.UTF-8 UTF-8" in file /etc/locale.gen has remained commented; so I uncommented that line and ran:
$ sudo locale-gen
After that, I edited line "LANG=en_US.utf8" to "LANG=en_US.UTF-8" in /etc/locale.conf file.
Finally, I ran gnome terminal and it came up!

Fish shell unable to render symbols properly

Fish shell is not displaying symbols properly in gnome-terminal (Ubuntu 17.04).
Fish prompt symbol
Staging index status
-
locale output
LANG=en_IN
LANGUAGE=en_IN:en
LC_CTYPE=en_IN
LC_NUMERIC="en_IN"
LC_TIME="en_IN"
LC_COLLATE="en_IN"
LC_MONETARY="en_IN"
LC_MESSAGES="en_IN"
LC_PAPER="en_IN"
LC_NAME="en_IN"
LC_ADDRESS="en_IN"
LC_TELEPHONE="en_IN"
LC_MEASUREMENT="en_IN"
LC_IDENTIFICATION="en_IN"
LC_ALL=
You should set your locale to a UTF-8-containing locale (ie en_IN.UTF-8). Ubuntu normally does this by default, so perhaps you should run sudo update-locale LANG=en_IN.UTF-8 LANGUAGE="en_IN:en".
If that still fails to work, in the GNOME Terminal profile settings, under the compatibility tab, try setting "Ambiguous-width characters" to "Wide" instead of "Narrow".

Changing locale in Ubuntu 15.04 VPS is not being saved

I just bought a VPS and I'm playing it it using SSH.
After a few software packages installations I saw that I had a problem with locales (I need to have en_US.UTF-8 but I have Latin1. I googled it but even after I think I've changed locales then they keep returning to the original ones and I still get problems with software installation.
So, I get:
root#myname:~# locale
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=pt_PT.UTF-8
LANGUAGE=
LC_CTYPE="pt_PT.UTF-8"
LC_NUMERIC="pt_PT.UTF-8"
LC_TIME="pt_PT.UTF-8"
LC_COLLATE="pt_PT.UTF-8"
LC_MONETARY="pt_PT.UTF-8"
LC_MESSAGES="pt_PT.UTF-8"
LC_PAPER="pt_PT.UTF-8"
LC_NAME="pt_PT.UTF-8"
LC_ADDRESS="pt_PT.UTF-8"
LC_TELEPHONE="pt_PT.UTF-8"
LC_MEASUREMENT="pt_PT.UTF-8"
LC_IDENTIFICATION="pt_PT.UTF-8"
LC_ALL=
But before, I have done:
locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LS_ALL=en_US.UTF-8
So, I can I solve this forever?
PS: I'm doing all this using SSH.
That's because my locale in my local machine is set to Portuguese, which SSH forwards to and tries to use on the server, but the server does not have it installed.
I could have stopped forwarding the locale environment variable from my local machine to the server. To do that I would have commented the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
Instead I decided to:
1) Generate the locale - Generate the English locale on the server with sudo locale-gen en_US.UTF-8
2) Stop accepting locale environment variable from my local machine to the server. To do that I commented the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file. Note that for this I had to install the nano package to edit the file (after sudo apt-get install nano I just did nano filename when I was in the file directory).
3) Set the server locale to English - by adding the following lines to my remote ~/.bashrc or ~/.profile files using nano filename again (don't forget they are hidden files inside your home directory so they won't appear in a simple ls search; you need to use ls -la command):
export LANGUAGE="en"
export LANG="C"
export LC_MESSAGES="C"
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LS_ALL=en_US.UTF-8
I also restarted the VM and before that I closed my SSH session and reenter to see if changes were working.

Terminal only shows $

I tried building my own linux distribution and I follow the Linux From Scratch book. When I tried entering the following commands in bashrc.
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL PATH
After this when I restart the terminal. I am seeing only $ symbol. I thought that entry I made in bashrc is the problem. So, I reverted back it and restarted the system too. But, still am seeing the same problem. Also, the auto completion too not working. Please, help me to get rid of this.
Welcome to stackoverflow
You should set the 'PS1' variable. Search it
This is my PS1, for example:
\[\e]0;\u#\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[00;32m\]\u#\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
Sorry folks, I got my terminal back by reinstalling bash shell by executing the following command
sudo apt-get install --reinstall bash

cygwin/X version 1.17 xinit version 1.3.* breaks run.exe

i have been using cygwin/X for many years and have not had any major problems, until the upgrade of xinit to version 1.3.x, it breaks everything without any warning at all. people wonder why open source gets such a bad reputation, it's this kind of blindsiding that does it...
anyway, prior to xinit 1.3.x i started Xwin via the Xwin icon. i could then start xterm (or emacs or any X application) using run.exe which i would pin to the taskbar. my command line is as such:
D:\cygwin\bin\run.exe -p /bin bash ~/scripts/xterm.sh
my xterm.sh is as follows:
export DISPLAY=127.0.0.1:0.0
xterm &
exit
this has worked like a charm for YEARS, now it doesn't do anything.
even doing this in a windows cmd:
set DISPLAY=127.0.0.1:0.0
d:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm
doesn't work anymore...
does anyone know how to start an Xwin application (xterm, emacs ...) via the dos command line ...
Try to set DISPLAY to :0.0 (not 127.0.0.1:0.0). Source.

Resources