Skip to content
Ubuntu Linux

How to Set System Locale on Ubuntu 24.04

Richard
Written by
Richard
Updated 4 min read
How to Set System Locale on Ubuntu 24.04
How to Set System Locale on Ubuntu 24.04

System locale on Ubuntu 24.04 controls the language, date formats, number formats and currency symbols your computer uses in menus, the terminal and apps. A common example is en_US.UTF-8, the standard US English setting.

Changing it takes a few terminal commands. You check the current locale, install a language pack if you need one, generate the locale, set it as the system default, and verify the result. You need an account with sudo rights for the middle steps.

⚡ Quick Answer

Go to Settings Region & Language to choose your preferred language and formats. For terminal users, use `sudo localectl set-locale LANG=your_locale` after ensuring the necessary language packs are installed and generated with `sudo locale-gen`.

Advertisement

Introduction

The system locale tells Ubuntu how to handle dates, numbers, sorting and text encoding for your region. It is a system-wide default. Individual users can still override parts of it in their own settings, which is why the terminal and the desktop sometimes show different results. The steps below work the same on Ubuntu Desktop and Ubuntu Server.

Check your current settings

Check what the system is using now, so you know what to change back to if needed.

Advertisement
  1. Open a terminal. Press Ctrl+Alt+T, or search for Terminal in the Activities overview.
  2. Type the command below and press Enter to see your current locale %📂%LNK0%%:

localectl

The terminal prints a list of variables. Look for the line that says LANG=. This shows your current language and region. Write it down before you change anything, so you can go back to it later.

Search and install additional locales

Language packs provide the translation and locale files for a language. You need the pack for a language before you can use it as your system locale. If you only want a locale that is already installed, such as English, you can often skip this section.

  1. Search for available packs by running apt search language-pack- in the terminal. You will see a long list, one package per language.
  2. Find the pack for your language and install it with sudo apt install followed by the pack name. Enter your password when asked. The terminal shows nothing while you type it, which is normal.

Use the command below as the pattern:

apt search language-pack-

Installing a language pack adds that language’s files to the system. It does not switch anything by itself. For example, sudo apt install language-pack-fr adds the French files, so you can then change the displayed language to French.

  1. Run the install command shown below.
  2. Wait for apt to finish. You should be returned to the prompt without errors. If apt says it cannot find the package, check the spelling of the pack name.

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

Next, generate the locale with the locale-gen command. It builds the language and regional data the system needs. Without it, apps may not display dates, numbers and text correctly for your chosen language, and the system may fall back to another locale.

  1. Run the command below with sudo.
  2. Watch the output. It should list the locale or locales being generated, then return to the prompt.

sudo locale-gen fr_FR.UTF-8

Finally, check that the new locale is ready to use. Run the command below and look for your locale in the list. If it is missing, go back and repeat the generation step before moving on.

localectl list-locales

Change system locale

Now set the generated locale as the system default. You do this from the command line with sudo localectl set-locale followed by your preferred setting, such as LANG=fr_FR.UTF-8.

  1. Run the command below, replacing the locale with the one you generated. The locale name must match what you saw in the previous section.
  2. Enter your password if asked. The command normally prints nothing when it succeeds.
  3. Run localectl by itself to check the new settings. The System Locale line should show your new value.

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

Verify the change by running localectl again. The change does not apply to sessions that are already running, so you need to restart something first.

  • Logging out of your user account and logging back in is usually enough to apply the change to your personal environment.
  • A full restart makes sure the change applies globally, including to every service.

To undo the change, repeat the set-locale step with your original value, for example the one you wrote down earlier. Then log out and back in again.

Conclusion

A correctly set system locale makes your computer behave as you expect. Dates, numbers, currency and text all follow your region, and menus and apps show the language you chose. If something still looks wrong after you log back in, run the check commands again. Make sure the locale you set is the one that was generated.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

No comments yet — be the first to share your thoughts!

Leave a Comment

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