How to Set System Locale on Ubuntu 24.04

This article guides Ubuntu 24.04 users on setting their system locale, which affects language and regional settings. It explains how to list, install, and change language packs via the terminal, ensuring correct date, time, and number formats. Users are advised to restart their system to apply changes effectively.

This article explains how to set your system locale on Ubuntu 24.04.

A system locale determines your system’s language and regional settings, including text display, date and time formats, number formatting, and other locale-specific configurations.

The locale is a set of parameters that defines your environment based on language and regional preferences.

Different regions have various formats for displaying dates and times. Setting the locale ensures these formats are adjusted to your preferences (e.g., MM/DD/YYYY versus DD/MM/YYYY).

If you choose a language other than English, setting the locale ensures that menus, dialogues, and other interface elements display in your selected language.

Set the system locale using the terminal

Users can use the command line terminal to configure their system locale on Ubuntu. The following steps will guide you on how to do this.

First, run the command below to list your device’s system locale.

localectl

The command should output something similar to the lines below.

System Locale: LANG=en_US.UTF-8
VC Keymap: (unset)
X11 Layout: us
X11 Model: pc105

This is the current system locale for your machine.

Search and install additional locales

If you want to switch to a different locale, use the steps below.

First, run the command below to search all supported language packs and available locales.

apt search language-pack-

The command should output something similar to the lines below.

Sorting... Done
Full Text Search... Done
language-pack-af/noble-updates 1:24.04+20250130 all
translation updates for language Afrikaans

language-pack-af-base/noble-updates 1:24.04+20250130 all
translations for language Afrikaans

language-pack-am/noble-updates 1:24.04+20250130 all
translation updates for language Amharic

language-pack-gnome-fr/noble-updates 1:24.04+20250130 all
GNOME translation updates for language French

language-pack-gnome-fr-base/noble-updates 1:24.04+20250130 all
GNOME translations for language French

With the information available, you can install the language pack you want. For this post, we’ll be installing the French language pack.

Run the command below to do that.

sudo apt install language-pack-gnome-fr-base language-pack-fr

After installing the new language pack, execute the command below to display all installed language packs.

localectl list-locales

Depending on the number of language packs installed, you should see all listed.

C.UTF-8
en_IN.UTF-8
en_NG.UTF-8
en_NZ.UTF-8
en_PH.UTF-8
en_SG.UTF-8
en_US.UTF-8
en_ZA.UTF-8
en_ZM.UTF-8
en_ZW.UTF-8
fr_BE.UTF-8
fr_CA.UTF-8
fr_CH.UTF-8
fr_FR.UTF-8
fr_LU.UTF-8

The newly installed French language packs are shown at the bottom of the page.

Change system locale

Now that you’ve decided which language pack to use, execute the command below to modify your system locale.

For example, you can switch to French by using the command below.

sudo localectl set-locale LANG=fr_FR.UTF-8

After changing it, check to see if it has changed on your system.

localectl

It should output something similar to the lines below.

System Locale: LANG=fr_FR.UTF-8
VC Keymap: (unset)
X11 Layout: us
X11 Model: pc105

Restart your computer to apply the changes.

That should do it!

Conclusion:

Setting your system locale on Ubuntu 24.04 is essential for customizing your language and regional preferences. Here are the key takeaways:

  • A well-configured locale enhances user experience by displaying menus and dialogues in your preferred language.
  • Correct locale settings ensure that dates, times, and numbers are formatted according to cultural norms.
  • The command line is a powerful tool for listing, installing, and changing locales.
  • Always check your current locale and verify changes after installation.
  • Restart your system to ensure all updates and changes take effect.

Following the steps outlined in this article, you can easily adjust your system locale to suit your needs.

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *