Debian: What is wrong here? locale-gen seems crazy
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Debian: What is wrong here? locale-gen seems crazy
These terminal line lines show a problem with locales I have with a Debian 9 now. Check the commands and a few details on their output:
Code:
$ locale -a
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
C.UTF-8
POSIX
en_US.utf8
$ # so there are 4 locales installed
$ sudo -s
bash: warning: setlocale: LC_ALL: cannot change locale
(pt_BR.utf-8)
# locale-gen pt_BR.utf8 # note which locale we generate!
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
# I did not ask to generate that! Again.
# locale-gen pt_BR.UTF8
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
# exit # Give up.
$
Just a guess, but what does your "/etc/default/locale" look like? Was this working before, what changed if so? What is the output of the command "locale" with no switches?
Last edited by sevendogsbsd; 10-28-2017 at 01:02 PM.
Just a guess, but what does your "/etc/default/locale" look like? Was this working before, what changed if so? What is the output of the command "locale" with no switches?
That machine never totally worked (or is not configured to do so, as I think). The locale problem is strange because what I found and tried to fix it, did not really work.
Code:
$ cat /etc/default/locale
# File generated by update-locale
LANG="en_US.UTF-8"
$ 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="pt_BR.utf-8"
LC_NUMERIC="pt_BR.utf-8"
LC_TIME="pt_BR.utf-8"
LC_COLLATE="pt_BR.utf-8"
LC_MONETARY="pt_BR.utf-8"
LC_MESSAGES="pt_BR.utf-8"
LC_PAPER="pt_BR.utf-8"
LC_NAME="pt_BR.utf-8"
LC_ADDRESS="pt_BR.utf-8"
LC_TELEPHONE="pt_BR.utf-8"
LC_MEASUREMENT="pt_BR.utf-8"
LC_IDENTIFICATION="pt_BR.utf-8"
LC_ALL=pt_BR.utf-8
Everything I tried, to change LANG (and others) on that machine, did not work. The first 3 lines of 'locale' without switches output show a problem. I want to change: default locale (I guess you have already showed me); users may change their locale to a different one, but that is not working as it did in other debianish distros.
Hmmm, well, your default shows as "en_US.UTF-8" but you have "pt_BR.utf-8" listed as "LC_CTYPE", etc. Not a locale guru but that seems odd. What do you have uncommented in /etc/locale.gen?
Hmmm, well, your default shows as "en_US.UTF-8" but you have "pt_BR.utf-8" listed as "LC_CTYPE", etc. Not a locale guru but that seems odd. What do you have uncommented in /etc/locale.gen?
The computer came from USA with everything Usonian. The LC_* being pt_BR now are due things I did.
Tne only uncommented line from my /etc/locale.gen was en_US....!
Now I am changing that... to add a few more.
No guru needed, it should be just my usual problems with basic things.
(:
But I have searched around a bit, what I have found did not work - as I said above.
After the previous post, I have uncommented pt_* and a few other en_* lines in the file /etc/locale.gen . After that, I closed root account and typed "bash" in the parent terminal.
The error about LC_* variables changed! Now it complained only about LC_ALL:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.