Re: set gnome locales to C.UTF-8
On Fri 28 Feb 2020 at 23:19:07 (+0100), Jonas Smedegaard wrote:
> Quoting Ted Baker (2020-02-28 22:41:27)
> > Thanks, I was referring to john doe's earlier comment "In other words,
> > one language needs to be selected in order to be able to choose 'none'
> > (use none if you access the host through SSH) or 'C.UTF-8."
> >
> > And the fact that in dpkg-reconfigure locales, I didn't see the option
> > for C.UTF-8.
>
> You are asked first which locales to generate, then which to use per
> default.
>
> There's nothing to _generate_ for C.UTF-8 so you won't find it in first
> dialog, only in second.
I couldn't quite replicate john doe's post as posted:
--✄--------
$ DEBIAN_FRONTEND=text dpkg-reconfigure locales
bash: dpkg-reconfigure: command not found
$ DEBIAN_FRONTEND=text /usr/sbin/dpkg-reconfigure locales
/usr/sbin/dpkg-reconfigure must be run as root
$
# DEBIAN_FRONTEND=text dpkg-reconfigure locales
Configuring locales
-------------------
Locales are a framework to switch between multiple languages and allow
users to use their language, country, characters, collation order, etc.
Please choose which locales to generate. UTF-8 locales should be
chosen by default, particularly for new installations. Other character
sets may be useful for backwards compatibility with older systems and
software.
1. All locales 167. es_BO ISO-8859-1 333. mn_MN UTF-8
[…]
165. es_AR ISO-8859-1 331. mk_MK.UTF-8 UTF-8 497. none of the above
166. es_AR.UTF-8 UTF-8 332. ml_IN UTF-8
(Enter the items you want to select, separated by spaces.)
Locales to be generated:
--✄--------
Finding item 497, I continued:
--✄--------
Locales to be generated: 497
Generating locales (this might take a while)...
Generation complete.
*** update-locale: Error: invalid locale settings: LANG=en_US.UTF-8
#
--✄--------
And, as a consequence of this:
--✄--------
~# 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=en_US.UTF-8
LANGUAGE=
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=
#
--✄--------
Now the first question was "Please choose which locales to generate."
As it happens, I don't need to *generate* any, because I selected
en_US.UTF-8 at installation time.
So the next step was to rectify the situation:
--✄--------
# DEBIAN_FRONTEND=text dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Configuring locales
-------------------
Locales are a framework to switch between multiple languages and allow
users to use their language, country, characters, collation order, etc.
Please choose which locales to generate. UTF-8 locales should be
chosen by default, particularly for new installations. Other character
sets may be useful for backwards compatibility with older systems and
software.
1. All locales 167. es_BO ISO-8859-1 333. mn_MN UTF-8
[…]
164. eo UTF-8 330. mk_MK ISO-8859-5 496. zu_ZA.UTF-8 UTF-8
165. es_AR ISO-8859-1 331. mk_MK.UTF-8 UTF-8
166. es_AR.UTF-8 UTF-8 332. ml_IN UTF-8
(Enter the items you want to select, separated by spaces.)
Locales to be generated: 158
Many packages in Debian use locales to display text in the correct
language for the user. You can choose a default locale for the system
from the generated locales.
This will select the default language for the entire system. If this
system is a multi-user system where not all users are able to speak
the default language, they will experience difficulties.
1. None 2. C.UTF-8 3. en_US.UTF-8
Default locale for the system environment: 3
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
#
--✄--------
It seems odd to give an option 497, but then not know how to deal
with it. (The same error can be provoked in the TUI by providing
no * selection.)
The upshot is that, if you have a locale set to, say, en_US.UTF-8,
you have to run dpkg-reconfigure locales twice in order to
"unset" it: once to select None or C, and again to unset en_US.UTF-8.
However, it's not clear to me what the "unset"ting it actually does,
if anything. dpkg-reconfigure could be a bit clearer about what it
*does* do when it emits that error message.
BTW gnome is not installed here.
Cheers,
David.
Reply to: