• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

locale-gen: command not found

by admin

Internationalization and localization are two concepts that allow a computer to store information one way but display it in a way that suits the conventions of the user. Internationalization allows a system to display information in different ways, and localization is a process that bundles up all the regional changes for a single location into a locale.

Each locale file contains instructions on how to display or translate a variety of items:

  • Addresses: Ordering of various parts in zip code format.
  • Collation: How to sort, such as the ordering of accented characters or whether capitalized words are grouped together or separately from lowercase.
  • Measurement: Display of various units.
  • Messages: Translations for system messages and errors.
  • Monetary: How currency symbols are displayed and named.
  • Names: Conventions for displaying people’s names.
  • Numeric: How to display numbers such as the thousands and decimal separators.
  • Paper: Paper sizes used in the country.
  • Telephone: How telephone numbers are displayed.
  • Time: Date and time formats, such as the ordering of year, month, and date, or 24-hour clock versus using a.m. and p.m.

These locale files are usually distributed with the operating system as separate packages to save on space. If you don’t need the translations, you can generate the rest of the items without installing packages by using locale-gen on systems that support it. For example:

# locale-gen fr_FR.UTF-8
Generating locales...
 fr_FR.UTF-8... done
Generation complete.
# locale -a | grep FR
fr_FR.utf8

If you encounter below error while running the locale-gen command:

locale-gen: command not found

you may install the locales package as per your choice of distribution.

Distribution Command
Debian apt-get install locales
Ubuntu apt-get install locales
Arch Linux pacman -S glibc
Kali Linux apt-get install locales
CentOS yum install glibc
Fedora dnf install glibc
Raspbian apt-get install locales

Internationalization in Linux is handled with the GNU gettext library. If programmers write their applications with that library and annotate their messages correctly, the user can change the behavior with environment variables.

Multiple things can be localized, such as numbers and messages, and gettext has a series of environment variables that it checks to see which locale is appropriate. In order, these are:

  • LANGUAGE
  • LC_ALL
  • LC_XXX
  • LANG

Filed Under: Linux

Some more articles you might also be interested in …

  1. /etc/rsyslog.conf – Setup a Filter to Discard or Redirect Messages
  2. CentOS / RHEL 7 : How to disable all tty consoles and enable only 1
  3. CentOS / RHEL : How to block incoming and outgoing ports using iptables
  4. lsusb Command Examples in Linux
  5. How to configure CentOS/RHEL 6 system to not used last 3 passwords used
  6. ncat: command not found
  7. adig: command not found
  8. sed: command not found
  9. How to transfer files securely using sftp (examples included)
  10. imgp: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright