LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 04-21-2013, 04:30 AM   #1
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
Warnings about locale - I want to understand...


I have build lfs several times, and every time I get 'bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)'. I started a new build of chapter 6 yesterday, shutdown my computer at night, and when I re-entered the chroot today I got this warning. Last package I build yesterday was gcc. I didn't see this warning yesterday.

I have googled, and there are lots and lots of hits with this warning as title. Most of them says one should generate the language with whatever tool the distro has, and then put it in /etc/profile. I have done that. Some said it disappeared after reboot.

I have seen this so many times now, and I want to understand what it is about. Every time so far it's gone away by itself, I think after booting up the new system. Is there a way to get rid of the warnings before that? What happens at boot that makes it go away?

Code:
(chroot) root:/# locale -a
C
en_US
en_US.iso88591
en_US.utf8
POSIX
sv_SE
sv_SE.iso88591
sv_SE.utf8
Code:
(chroot) root:/# cat /etc/profile
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

umask 022

#export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"

#export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig

for script in /etc/profile.d/*.sh ; do
        if [ -r $script ] ; then
                . $script
        fi
done

Edit: And after finishing lfs and rebooting - it booted up nicely -, back to chroot to start with blfs, and the warnings are again mysteriously gone... But I still want to know what this is about.

Last edited by Lennie; 04-21-2013 at 08:05 AM.
 
Old 04-22-2013, 03:20 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
What locales have you got in glibc/uclibc?? Uclibc is embarassed for locales, IIRC.
 
Old 04-23-2013, 01:16 AM   #3
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Quote:
Originally Posted by business_kid View Post
What locales have you got in glibc/uclibc?? Uclibc is embarassed for locales, IIRC.
I don't understand the question...

The locales I generated after building glibc are, as I showed in my previous post, english and swedish.
 
Old 04-23-2013, 08:29 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
In Code tags (# on the formatting bar), please post the output of

Code:
ls /usr/share/locale
 
Old 04-23-2013, 09:53 AM   #5
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Code:
$ ls /usr/share/locale
af   de           et           ia  locale.alias  pt              sr@latin
ar   de_AT        eu           id  lt            pt_BR           sv
ast  de.us-ascii  fa           is  lv            pt_BR.us-ascii  th
az   dz           fi           it  ms            pt.us-ascii     tl
be   el           fr           ja  nb            ro              tr
bg   en@boldquot  fr.us-ascii  ka  ne            ru              uk
bs   en_GB        ga           kk  nl            rw              vi
ca   en@quot      gl           km  nn            sk              wa
crh  eo           he           ko  no.us-ascii   sl              zh_CN
cs   es           hr           ky  pa            sq              zh_HK
da   es.us-ascii  hu           lg  pl            sr              zh_TW
 
Old 04-24-2013, 03:47 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Last time I did LFS, it didn't have UTF-8 so I really don't know what's up. I don't see any utf-8 locales. That's the sort of thing you'll sort quickly by searching the LFS mail archives. You apparently have enough locales made, which is really what I was checking. I would go straight to the glibc page and read it again, then search the archives
 
Old 05-21-2013, 01:23 PM   #7
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Yet another build with the same disturbing warnings spamming my logs. I realized that if I comment out
Code:
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
from /etc/profile and re-login, the warnings go away. I guess the system is not yet ready to set the locale...
 
Old 05-22-2013, 02:59 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Seeing as you're going LFS, check the hints for a Unicode hint. Might make life easier.
 
Old 05-22-2013, 10:00 AM   #9
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I guess you mean one should avoid using utf, as the book also said. I tried 'en_US.iso88591', but then some of the special characters didn't show correctly. I tried it both for console and X, and none of them worked. So far I haven't had any problem with utf.

I didn't find any hint about it, I searched for it in the hints page.
 
Old 05-22-2013, 02:04 PM   #10
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I did LFS a while back, 2000 - 2003 or so. Back then, LFS was not utf8 compliant. The issue was that there were patches needed which maintainers were not accepting for various programs to go unicode and so the thing was bogged down. I gather the distros would have put pressure on; Red hat just patched away, and gave a middle finger to the maintainers. Some guy (Alexander Patrakov?) at LFS was beavering away on it and knew all there was to know about it, him being Russian.

You can select any locale from /usr/share/locale. From your list, I don't see unicode in there. Even then, they won't all be trouble free. Unicode hits at the GNU stuff, which is old style unix text based, and needs a shake up from maintainers who didn't write it for the most part. So they are a tad unwilling to rewrite it.
 
Old 10-27-2013, 12:35 PM   #11
AN28
Member
 
Registered: Apr 2013
Posts: 93

Rep: Reputation: 0
Hi guys,

I know this thread was active a while back but I am coming across the same warning as Lennie.
Is it ok to go ahead? Or should I make changes by selecting another locale?

I tried running the command as given in post #4 but then i get a message
Quote:
bash: ls: command not found
 
Old 10-27-2013, 02:11 PM   #12
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
The original error for this thread is harmless, and caused by having the locale set before first boot and re-entering the chroot.

Quote:
Originally Posted by AN28
Code:
bash: ls: command not found
What's your $PATH? I guess you re-entered the chroot and didn't set up the environment properly.
 
Old 10-27-2013, 10:18 PM   #13
AN28
Member
 
Registered: Apr 2013
Posts: 93

Rep: Reputation: 0
This result is attached in the screenshot
Attached Thumbnails
Click image for larger version

Name:	bash warning.png
Views:	72
Size:	178.9 KB
ID:	13819  
 
Old 10-28-2013, 03:15 AM   #14
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Are you running those commands from Salix, or are you already inside the chroot (without knowing it)? It seems either Salix is foobared or something went wrong when you installed coreutils. All those commands are from coreutils. Strange echo works but not the others...

How far in the build have you come? Which package was the last installed? Was everything working before you left the chroot? More info is needed to help you.
 
Old 10-28-2013, 04:23 AM   #15
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The screenshot is saying "chroot: command not found." You have the potential to mix yourself and us up totally, not know which system you are in, and hack apart your real system as long as that continues.
Go away. close whatever terminal you got that from and get a clean flawless chroot as per the book. Fix things or go back as necessary to get that. If you can't, post your issues.
I
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
locale: Cannot Set LC_ALL to default locale: No such file or directory. asym Linux - General 11 10-24-2018 05:54 PM
How to change the locale by setting the system default locale letdoit Slackware 6 08-18-2011 03:34 AM
after-Installation errors. locale error. unsupported locale settings and two more gh0st Fedora 1 05-02-2008 05:06 AM
locale: Cannot set LC_ALL to default locale: Invalid argument GadgetWiz Mandriva 1 03-31-2006 11:38 PM
strange locale warnings in Mandrake 10.1 Mistreated Linux - Software 1 02-09-2005 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration