Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale issue, need to install glibc-langpack-* package #60

Closed
mildred opened this issue Feb 23, 2019 · 10 comments
Closed

Locale issue, need to install glibc-langpack-* package #60

mildred opened this issue Feb 23, 2019 · 10 comments
Labels
1. Bug Something isn't working 5. Good First Issue Good for newcomers 5. Help Wanted Extra attention is needed
Milestone

Comments

@mildred
Copy link

mildred commented Feb 23, 2019

using stack to build a haskell program inside Fedora toolbox, I got a strange error that I could track down to a locale issue. There were other issues such as less not showing up UTF-8 byte sequences. Running locale showed up errors:

$ 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=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=

Installing the glibc-langpack-fr package (in my case) solved the issue. That should probably be performed when the toolbox is created the first time. Or it could be part of the documentation.

@debarshiray
Copy link
Member

debarshiray commented Feb 25, 2019

Yes, I have heard of a similar oddity reported by Czech users too, but since locale seemed to work fine for variants of en (not just en_US), I forgot about it.

Do you know how the glibc-langpack-fr package gets installed on your Fedora host?

@debarshiray
Copy link
Member

Thanks to @halfline I understand this a little better.

It's likely that replacing glibc-minimal-langpack with glibc-all-langpacks will solve the most pressing issues:

# dnf -y swap glibc-minimal-langpack glibc-all-langpacks

I think that a complete fix would also involve removing /etc/rpm/macros.image-language-conf and reinstalling all packages with missing translations. That would involve something similar to #55, which undoes the effects of tsflags=nodocs.

@debarshiray
Copy link
Member

It would also be helpful to have a concrete test case that I can use to validate my experiments.

@juhp
Copy link
Contributor

juhp commented Mar 6, 2019

A simpler fix or workaround for now might be just to run podman with LANG=C.utf8.
That should fix most of the current problems I reckon.

Minimalist testcase is just to run locale:

@toolbox ~ $ 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=ja_JP.UTF-8
:

@mildred
Copy link
Author

mildred commented May 27, 2019

I don't know if this is following up this issue or not, but in a recent toolbox, the locale is no longer preserved from the host. now I get the en_US.UTF-8 locale, no locale error, and the same vim issues as in #14 (except not running inside tmux)

@juhp
Copy link
Contributor

juhp commented May 29, 2019

Currently toolbox only installs glibc-langpack-en by default.
edit I think this is inherited from the fedora:30 image.

@juhp
Copy link
Contributor

juhp commented Jul 20, 2019

In latest fedora:30 (and fedora:rawhide) glibc-langpack-en was dropped.
eg this affects https://bodhi.fedoraproject.org/updates/FEDORA-CONTAINER-2019-724ac61633

Actually it looks to me the real problem is that fedora:30 /etc/locale.conf has LANG="en_US.UTF-8":
assuming the above change is intentional.
We could workaround it with sed -e 's/en_US/C' /etc/locale.conf.

@juhp
Copy link
Contributor

juhp commented Jul 20, 2019

Okay it seems covered by https://bugzilla.redhat.com/show_bug.cgi?id=1727489

@A6GibKm
Copy link

A6GibKm commented Oct 9, 2019

Can confirm that installing glibc-langpack-en or glibc-alll-langpacks fixes this issue. Havee in mind that the later weigth about 200mb which is half's the container weigth.

@ghost
Copy link

ghost commented Oct 9, 2019

Running $ toolbox run locale on the host yields:

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
LC_CTYPE="en_US.UTF-8"
(...)

It seems to inherent the host's locale, which is not the case when running $ locale within a containerized shell session:

$ toolbox enter
⬢$ locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
(...)

While I am not certain whether it is a separate issue, installing glibc-langpack-en or glibc-all-langpacks fixes it for me. I'm on Fedora 31 Silverblue.

@HarryMichal HarryMichal added this to Needs triage in Priority Board Jul 28, 2020
@HarryMichal HarryMichal added this to the Release 0.1.0 milestone Sep 10, 2020
@HarryMichal HarryMichal moved this from Needs triage to Low priority in Priority Board Sep 10, 2020
@HarryMichal HarryMichal added 1. Bug Something isn't working 5. Good First Issue Good for newcomers 5. Help Wanted Extra attention is needed labels Sep 10, 2020
nievesmontero added a commit to nievesmontero/toolbox that referenced this issue Sep 29, 2022
This new packet allows the user to set a locale inside the
toolbox and make locale dependent commands work

containers#60

Signed-off-by: Nieves Montero <nmontero@redhat.com>
matthiasclasen pushed a commit that referenced this issue Sep 29, 2022
This new packet allows the user to set a locale inside the
toolbox and make locale dependent commands work

#60

Signed-off-by: Nieves Montero <nmontero@redhat.com>
vorburger added a commit to vorburger/vorburger-dotfiles-bin-etc that referenced this issue Oct 1, 2022
debarshiray added a commit to debarshiray/toolbox that referenced this issue Jan 31, 2023
debarshiray added a commit to debarshiray/toolbox that referenced this issue Feb 1, 2023
Changes to the RPM configuration should happen before DNF is used.
Otherwise, those changes won't affect the DNF invocations.

Fallout from f5388cf

containers#60
debarshiray added a commit to debarshiray/toolbox that referenced this issue Feb 1, 2023
debarshiray added a commit to debarshiray/toolbox that referenced this issue Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working 5. Good First Issue Good for newcomers 5. Help Wanted Extra attention is needed
Projects
No open projects
Priority Board
  
Low priority
Development

No branches or pull requests

6 participants