- 1 1. Introduction
- 2 2. Checking Your Current Locale Settings
- 3 3. What to Do If the Japanese Locale Is Missing
- 4 4. Generating and Enabling the Locale
- 5 5. System-Wide vs. User-Specific Locale Settings
- 6 6. Configuring Locale in the GUI (Ubuntu Desktop/GNOME)
- 7 7. Confirming and Troubleshooting Locale Settings
- 8 8. Locale Settings for Docker and WSL
- 9 9. FAQ (Frequently Asked Questions)
- 10 10. Conclusion
1. Introduction
In Ubuntu and other Linux environments, configuring the “locale” settings plays a crucial role. A locale is a system that optimizes your environment according to the language displayed by the system or applications, as well as formats for dates, times, currency symbols, and the usage of decimal points and commas—tailored to the culture and customs of each country or region.
For example, right after installing Ubuntu, the default environment is often set to English, which means system messages, application displays, and even date and number formats may be unfamiliar to Japanese users. To change these settings to Japanese or adapt them for use in Japan, configuring the “locale” is essential.
This is particularly important not only for server usage but also for daily use on Ubuntu Desktop, or in virtualized environments such as WSL (Windows Subsystem for Linux) and Docker. Setting the locale properly ensures Japanese language support, prevents garbled text, and improves the overall user experience.
This article provides a comprehensive guide to the role of locales in Ubuntu, how to configure them, and solutions to common issues. Whether you are just starting with Ubuntu or need to adjust your locale settings in an existing environment, this guide is for you.
2. Checking Your Current Locale Settings
Before changing your locale settings in Ubuntu, it’s important to first check what your current locale is set to. Here, we explain commands and methods you can use to check your locale settings.
The most basic way to check your locale is to run the locale
command in the terminal. This will display a list of the current locale settings. Key items in the output include:
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
...
“LANG” shows the default locale for the system, while each item starting with “LC_” indicates the settings for specific categories like character types, numbers, dates, and messages. For example, if you see “ja_JP.UTF-8” in “LANG” or “LC_MESSAGES,” it means the Japanese locale is enabled.
To check the full list of available locales, use the following command:
locale -a
This command lists all locales installed on the system. Make sure “ja_JP.UTF-8” or other Japanese-related locales are included in the list.
If the Japanese locale is not listed, or the locale
output is in English or unexpected values, you will need to add or change the locale settings using the steps explained below.
3. What to Do If the Japanese Locale Is Missing
If “ja_JP.UTF-8” or other Japanese locales do not appear in the locale -a
output, or Japanese display is not working correctly, you will need to add and enable the Japanese locale. Here’s how to do it in detail.
First, packages like “language-pack-ja” and “locales” are required to generate and use Japanese locales. If these are not installed, you won’t be able to use Japanese locales.
Installing the Required Packages
Run the following commands in your terminal to install the necessary Japanese language packages:
sudo apt update
sudo apt install language-pack-ja
Depending on your Ubuntu version and usage, it’s also a good idea to install the locales
package:
sudo apt install locales
Generating the Japanese Locale
After installing the packages, generate the Japanese locale with this command:
sudo locale-gen ja_JP.UTF-8
This will add the Japanese locale to your system, and “ja_JP.UTF-8” should now appear in the locale -a
output.
Applying the Locale Settings
Just installing or generating the locale may not activate it. Set the default locale to Japanese using the update-locale
command:
sudo update-locale LANG=ja_JP.UTF-8
This ensures that all new terminals and login sessions use the Japanese locale.
4. Generating and Enabling the Locale
Once the Japanese locale is available, you need to generate it and apply the settings system-wide. Use the following commands to enable the Japanese environment effectively.
Generating the Locale
Usually, running sudo locale-gen ja_JP.UTF-8
is enough. However, in some cases, you might need to manually edit the /etc/locale.gen
file and uncomment the necessary line.
- Open
/etc/locale.gen
with a text editor (e.g., nano):
sudo nano /etc/locale.gen
- If you find a line like “ja_JP.UTF-8 UTF-8” that starts with “#”, remove the “#” to uncomment it.
- Save and close the editor.
- Then generate the locales:
sudo locale-gen
Enabling the Locale
Next, use the update-locale
command to set Japanese as the system default:
sudo update-locale LANG=ja_JP.UTF-8
This command updates the /etc/default/locale
file, enabling the Japanese locale for future sessions.
If you want to set specific environment variables (e.g., LANG, LC_TIME, LC_MESSAGES), you can customize them as follows:
sudo update-locale LANG=ja_JP.UTF-8 LC_TIME=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8
When Settings Take Effect
The settings may not take effect immediately after running the commands. If that happens, log out and log back in, or restart the server to activate the new locale settings.
5. System-Wide vs. User-Specific Locale Settings
In Ubuntu, you can apply locale settings either system-wide or per individual user. By using both approaches according to your needs and policies, you can build a more flexible environment.
System-Wide Locale Settings
For system-wide settings, use the /etc/default/locale
file or the update-locale
command. This applies the same default locale to all users logging into the Ubuntu machine.
For example, running:
sudo update-locale LANG=ja_JP.UTF-8
automatically updates /etc/default/locale
, making Japanese (ja_JP.UTF-8) the default language for all users.
User-Specific Locale Settings
If you want to apply a different locale for a specific user, edit the configuration file in their home directory, such as ~/.pam_environment
:
- Log in as the target user and open the file:
nano ~/.pam_environment
- Add the following line:
LANG=ja_JP.UTF-8
You can also add LC_* variables as needed.
With this setting, the specified locale applies only when that user logs in. This is useful in environments with multiple users, such as having administrators use English and general users use Japanese.
Using the localectl Command
On systemd-based environments, you can also use the localectl
command to set and check the locale:
sudo localectl set-locale LANG=ja_JP.UTF-8
This also applies the setting system-wide, and it’s a convenient way to switch locales with a single command.
6. Configuring Locale in the GUI (Ubuntu Desktop/GNOME)
If you use Ubuntu for desktop purposes, many tasks can be performed intuitively via the GUI (Graphical User Interface), including locale settings. You can switch to Japanese without using commands.
How to Change Locale from the Settings Menu
- Open “Settings” from the menu at the bottom left or the left side of the screen.
- Select “Region & Language.”
- In the “Language” section, select “Japanese.”
- Additionally, setting the “Formats” section to “Japan” or “Japanese” will ensure that date, time, and currency are in Japanese formats.
- You may be prompted to restart or log out and back in for the changes to take effect. Follow the prompts as needed.
Configuring Input Methods (IME)
For smooth Japanese input, set up an IME (Input Method Editor). Ubuntu uses input frameworks like “Fcitx5” or “IBus,” with Japanese conversion engines such as “Mozc” or “Anthy” available by default.
- Go to “Settings” → “Region & Language” → “Input Sources” and add “Japanese (Mozc)” or similar.
- You can switch between Japanese and English input with a shortcut key (e.g., Super + Space).
Troubleshooting Garbled or Missing Japanese Text in the GUI
If Japanese does not display correctly or you see garbled text even after changing the language, check the following:
- Ensure font packages (like fonts-noto-cjk) are installed.
- If individual applications require language settings, select Japanese in their menus or settings screens.
- Restart or log out to confirm that the settings have been applied.
7. Confirming and Troubleshooting Locale Settings
After changing locale settings, confirm that the changes have taken effect. It’s also important to know how to handle cases where the settings don’t apply or you encounter issues like garbled text.
Checking Locale Settings
Open the terminal and run the following command to check your current locale:
locale
If “LANG=ja_JP.UTF-8” and each “LC_*” field are set to “ja_JP.UTF-8,” the Japanese locale is correctly applied.
If you want to check the available locales again, run:
locale -a
Make sure “ja_JP.UTF-8” is included.
Checking Date and Number Formats
Locale settings also affect how dates and numbers are displayed. For example, check the date format with:
date
If the output is in Japanese, the locale is working as expected.

Common Issues and Solutions
1. Garbled Characters
- Font settings may be incomplete. Install Japanese fonts with
sudo apt install fonts-noto-cjk
or similar.
2. Locale Settings Not Applied
- Log out or restart after changing settings.
- If settings are not applied after switching sessions, manually reload them with
source /etc/default/locale
.
3. Mixed English and Japanese
- Some LC_* environment variables may not be set, or application-specific settings may be required.
- You can unify all locale variables with
sudo update-locale LC_ALL=ja_JP.UTF-8
.
4. Special Environments (Docker, WSL, etc.)
- Each environment may require its own steps (see the next section).
By checking these points and troubleshooting, most locale-related problems can be resolved.
8. Locale Settings for Docker and WSL
In recent years, Ubuntu is often used in virtualized or containerized environments like Docker or WSL (Windows Subsystem for Linux). Locale settings are just as important here, though the steps can be a bit different.
Setting Locale in Docker
To use the Japanese locale in a Docker container, explicitly install the necessary packages and generate the locale in your Dockerfile. For example:
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y language-pack-ja locales && \
locale-gen ja_JP.UTF-8 && \
update-locale LANG=ja_JP.UTF-8
ENV LANG=ja_JP.UTF-8
ENV LANGUAGE=ja_JP:ja
ENV LC_ALL=ja_JP.UTF-8
This setup allows you to use the Japanese locale inside the container. It’s also a good practice to specify the environment variables when launching your application to ensure Japanese support.
Setting Locale in WSL
WSL allows you to run Ubuntu and other Linux distributions on Windows, but Japanese locale configuration can be confusing. In WSL, follow the same steps as with regular Ubuntu:
- Install the required packages:
sudo apt update
sudo apt install language-pack-ja locales
- Generate and enable the Japanese locale:
sudo locale-gen ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8
- Add the following environment variables to
.bashrc
or.profile
to apply the settings every time you log in:
export LANG=ja_JP.UTF-8
export LANGUAGE=ja_JP:ja
export LC_ALL=ja_JP.UTF-8
Troubleshooting Garbled Text or Japanese Input
- In WSL, the Windows-side font environment and terminal application (such as Windows Terminal) font settings also affect Japanese display. Select a font that supports Japanese characters to resolve garbled text.
- In Docker, if you are using a minimal image, be sure to install font packages as well.
Example:apt-get install fonts-noto-cjk
With these settings, you can comfortably use locale settings on Ubuntu in Docker and WSL environments.
9. FAQ (Frequently Asked Questions)
Here are answers to common questions about configuring locales in Ubuntu. Use these as tips for troubleshooting and managing your setup.
Q1. “ja_JP.UTF-8” is missing from the locale -a
output. What should I do?
A. The Japanese locale has not been generated yet.
Install the “language-pack-ja” and “locales” packages and generate the locale with the following commands:
sudo apt update
sudo apt install language-pack-ja locales
sudo locale-gen ja_JP.UTF-8
sudo update-locale LANG=ja_JP.UTF-8
After this, running locale -a
should show “ja_JP.UTF-8.”
Q2. I changed the locale settings but they’re not being applied. Why?
A. After changing the settings, you may need to log out and log back in or restart your system.
If the issue persists, check whether the environment variables are set correctly in /etc/default/locale
or ~/.pam_environment
.
Q3. Japanese characters are garbled in the terminal or some applications. What should I do?
A. The most common cause is missing Japanese fonts. Install them using the following command:
sudo apt install fonts-noto-cjk
Also, set your terminal or editor’s font to a Japanese-compatible font if needed.
Q4. If multiple locales are set, which takes precedence?
A. The precedence is: “LC_ALL > LC_* > LANG.”
To temporarily unify everything, use:
export LC_ALL=ja_JP.UTF-8
For permanent changes, edit /etc/default/locale
or ~/.pam_environment
.
Q5. Can I set up locales in Docker or WSL the same way as regular Ubuntu?
A. The basic steps are the same, but in Docker, specify locale generation and environment variable settings explicitly in your Dockerfile. In WSL, also pay attention to font settings on the Windows side.
See the relevant sections in this article for details.
Q6. Even after setting the language in the GUI, some parts still appear in English. Why?
A. Some system components or applications may not provide Japanese translations or may require separate language settings. Please also check each application’s settings screen.
These FAQs cover the most common sticking points with Ubuntu’s locale settings.
For more questions or unique cases, feel free to leave a comment or check the support page.
10. Conclusion
This article provided a comprehensive guide to locale settings in Ubuntu—from the basics to step-by-step Japanese localization, troubleshooting, and handling special cases like Docker and WSL.
Locales affect not just language, but also date, currency, and number formats, as well as character encoding. By configuring them correctly, you can significantly improve Ubuntu’s usability and create a stress-free work environment.
If you want to use Japanese, setting up the “ja_JP.UTF-8” locale is essential. Make use of both command-line and GUI options, as well as per-user customizations, to build your ideal environment.
Lastly, refer to the FAQs in this article so you’re always ready to handle any issues that may arise during actual use.
I hope this article helps all users who want to set up a Japanese environment on Ubuntu.