LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-03-2022, 09:10 AM   #1
todovvox
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian, Manjaro
Posts: 7

Rep: Reputation: 1
Locales were not being generated by dpkg-reconfigure locales on Debian


Hey, it's my first post, but I've been lurking here for a while and found a lot of solutions for my previous questions. Now I've been having a question according to locales on Debian Buster, release 10.12.

According to this question that I've posted on SO's board: https://unix.stackexchange.com/quest...ting-on-debian

I have solved my problem by running sudo apt-get install locales. But one question - what is sudo dpkg-reconfigure locales actually doing? Somebody said (somewhere else on the internet), that it is generating chosen locales. But for me - it wasn't doing anything. The locales were nowhere to be found on the system, thus those lines were popping up:
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
After running the command once again (sudo dpkg-reconfigure locales) - after installing them by apt-get install of course, and by choosing en_US.UTF-8 in the dpkg-reconfigure locales GUI, a message popped up:
locales-all installed, skipping locales generation
Which is understandable. I have just downloaded a package with all of the locales. So why dpkg-reconfigure locales didn't generate it first? Is it doing the same thing as apt-get install locales-all? But just installing certain locales, not all of them?

Last edited by todovvox; 04-03-2022 at 09:12 AM.
 
Old 04-03-2022, 09:34 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Very good question, but isn't really related to programming: it would fit better into some Debian-specific forum. Nonetheless, you can find out what scripts in some *.deb package do, if you unpack the package with `ar x <somepackagefile.deb>` (Midnight Commander is able to 'enter' into *.deb files, too.)
 
1 members found this post helpful.
Old 04-03-2022, 09:40 AM   #3
todovvox
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian, Manjaro
Posts: 7

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
Very good question, but isn't really related to programming: it would fit better into some Debian-specific forum. Nonetheless, you can find out what scripts in some *.deb package do, if you unpack the package with `ar x <somepackagefile.deb>` (Midnight Commander is able to 'enter' into *.deb files, too.)
Holy. I'm so sorry. I've somehow posted in that section, but it was supposed to land in Linux - Newbie corner. Probably because I was lurking this section and somehow swapped cards with the correct one. Can I ask someone here for moving that thread?
 
Old 04-03-2022, 10:29 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,874
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Check/edit your /etc/locale.gen file, make sure to add/uncomment the following lines:
Code:
# grep -v '^#' /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
pl_PL ISO-8859-2
pl_PL.ISO-8859-2 ISO-8859-2
pl_PL.IBM852 IBM852
pl_PL.CP1250 CP1250
pl_PL.UTF-8 UTF-8
When it is done, run `locale-gen`:
Code:
# locale-gen
Generating locales (this might take a while)...
  en_US.ISO-8859-1... done
  en_US.UTF-8... done
  pl_PL.ISO-8859-2... done
  pl_PL.CP1250... done
  pl_PL.IBM852... done
  pl_PL.ISO-8859-2... done
  pl_PL.UTF-8... done
Generation complete.
Then check your work:
Code:
LC_ALL=pl_PL.UTF-8 perl -v
LC_ALL=pl_PL.ISO-8859-2 perl -v
 
1 members found this post helpful.
Old 04-03-2022, 10:52 AM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by todovvox View Post
Can I ask someone here for moving that thread?
The way to do that is to use the report button on the first post of the thread and ask a mod to move it to the more suitable forum.

 
1 members found this post helpful.
Old 04-03-2022, 11:35 AM   #6
todovvox
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian, Manjaro
Posts: 7

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
Check/edit your /etc/locale.gen file, make sure to add/uncomment the following lines:
Code:
# grep -v '^#' /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
pl_PL ISO-8859-2
pl_PL.ISO-8859-2 ISO-8859-2
pl_PL.IBM852 IBM852
pl_PL.CP1250 CP1250
pl_PL.UTF-8 UTF-8
When it is done, run `locale-gen`:
Code:
# locale-gen
Generating locales (this might take a while)...
  en_US.ISO-8859-1... done
  en_US.UTF-8... done
  pl_PL.ISO-8859-2... done
  pl_PL.CP1250... done
  pl_PL.IBM852... done
  pl_PL.ISO-8859-2... done
  pl_PL.UTF-8... done
Generation complete.
Then check your work:
Code:
LC_ALL=pl_PL.UTF-8 perl -v
LC_ALL=pl_PL.ISO-8859-2 perl -v
You're right. I didn't ask for a solution since it works now, but after uncommenting some of these lines, it has generated required locales. So I could do that by editing locale.gen and using locale-gen command, or by using dpkg-reconfigure locales and previously uncommenting lines in locale.gen, OR by installing all of the locales by installing locales-all package, right?
 
Old 04-03-2022, 11:35 AM   #7
todovvox
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian, Manjaro
Posts: 7

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by boughtonp View Post
The way to do that is to use the report button on the first post of the thread and ask a mod to move it to the more suitable forum.

Thanks a lot. Just did that.
 
Old 04-03-2022, 04:10 PM   #8
todovvox
LQ Newbie
 
Registered: Apr 2022
Distribution: Debian, Manjaro
Posts: 7

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by NevemTeve View Post
Check/edit your /etc/locale.gen file, make sure to add/uncomment the following lines:
Code:
# grep -v '^#' /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
pl_PL ISO-8859-2
pl_PL.ISO-8859-2 ISO-8859-2
pl_PL.IBM852 IBM852
pl_PL.CP1250 CP1250
pl_PL.UTF-8 UTF-8
When it is done, run `locale-gen`:
Code:
# locale-gen
Generating locales (this might take a while)...
  en_US.ISO-8859-1... done
  en_US.UTF-8... done
  pl_PL.ISO-8859-2... done
  pl_PL.CP1250... done
  pl_PL.IBM852... done
  pl_PL.ISO-8859-2... done
  pl_PL.UTF-8... done
Generation complete.
Then check your work:
Code:
LC_ALL=pl_PL.UTF-8 perl -v
LC_ALL=pl_PL.ISO-8859-2 perl -v
I guess this solves the problem. I have checked now dpkg-reconfigure locales, and after generating those - it has those previously generated with locale-gen marked with an asterisk. Thank you.

Last edited by todovvox; 04-03-2022 at 04:12 PM.
 
1 members found this post helpful.
  


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
Locales problem? Linux SPSS statistics verison 27 on Chromebook not working. Problem with locales. Bjoernaakvik Linux - Newbie 4 02-21-2021 02:14 PM
dpkg-reconfigure not recognized for Debian Buster darry1966 Debian 2 05-02-2020 08:20 AM
Setting locale failed - Tried dpkg-reconfigure locales 31770 Ubuntu 1 02-02-2007 05:37 AM
dpkg-reconfigure locales dapper128 Ubuntu 0 09-11-2006 06:23 AM
CAN'T change default locale by dpkg-reconfigure locales Mathsniper Debian 3 06-26-2006 06:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 PM.

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