Ubuntu 18.04 Server / How to change the system language
To change the default language on Ubuntu 18.04 Server, prepare the locale and translation packages, configure update-locale, and log in again. This guide uses Korean, ko_KR.UTF-8, as the example and distinguishes the values saved in the configuration file from those active in your current session.
Check the current configuration and make a backup
A locale controls a program’s language, character encoding, date and number formats, and sorting conventions. This guide covers the Ubuntu 18.04 Server terminal environment; desktop input methods and keyboard layouts are separate settings.
Standard security maintenance for Ubuntu 18.04 LTS ended in May 2023. If you maintain an existing server, check your Ubuntu Pro expanded security maintenance coverage or operating system upgrade plan separately from the language setting. See the official Ubuntu release cycle for support details.
Sign in with an account that has sudo privileges and run these commands individually. locale shows the current session settings, locale -a lists available locales, and the final command displays the system default configuration file.
locale
locale -a
cat /etc/default/locale
If the session shows LANG=en_US.UTF-8, its default locale is US English. Check the variables below as well: their values can override individual categories or the complete locale.
| Variable | Purpose and what to check |
|---|---|
LANG |
The default locale used when a category has no separate setting. |
LC_*, such as LC_MESSAGES |
Override LANG for a particular category, such as messages, time, or numbers. |
LC_ALL |
Overrides all locale categories. It is generally useful for temporarily running a command under a specific locale rather than as a permanent default. |
LANGUAGE |
Sets translation preferences for messages in programs using GNU gettext. It does not change all date and number settings; check it when message language is unexpected. |
The Ubuntu 18.04 locale(7) manual explains the roles and precedence of these variables, including the use of LANGUAGE for translated messages. Programs without a Korean translation may still display English messages under a Korean locale.
Back up the default configuration file before changing it. If the backup filename below already exists, choose another name rather than overwriting the earlier backup. Use that actual filename when restoring it.
sudo cp -a /etc/default/locale /etc/default/locale.backup
Prepare the Korean locale and translation packages
Locale data and translated program messages have different purposes. Writing a locale name into a configuration file does not install its data or every program’s translations. Update the package lists and install the locale tools and Korean language pack first.
sudo apt-get update
sudo apt-get install locales language-pack-ko
sudo locale-gen ko_KR.UTF-8
locale -a
Proceed to each command only after the previous one finishes without errors. If the final list contains ko_KR.utf8, the Korean UTF-8 locale is available. The list may use .utf8 while the configuration examples use .UTF-8. Generating locale data with locale-gen and selecting the system default are separate operations. See the Ubuntu 18.04 locale-gen manual for details.
If a package cannot be found or a download fails, resolve errors from apt-get update, repository configuration, and network connectivity first. Setting a locale name after installation has failed can produce locale warnings in subsequent commands.
Change the system default language
Use the following settings if you want Korean locale defaults for date and number formatting as well as language.
sudo update-locale --reset LANG=ko_KR.UTF-8
cat /etc/default/locale
--reset removes variables not specified in the command from /etc/default/locale. This prevents existing LANGUAGE or individual LC_* entries in that file from overriding the Korean default. If you intentionally use another region for some categories, do not apply this option unchanged: preserve those settings and modify only the variables you need.
The configuration file should contain the following entry. Automatically generated comments may also be present.
LANG=ko_KR.UTF-8
update-locale checks the values and modifies the default configuration file, but it does not change environment variables inside an already running shell. The Ubuntu 18.04 update-locale manual describes this behavior and the meaning of --reset.
Log in again and verify the result
If you connected over SSH, disconnect and establish a new session. A server reboot is not normally required, but existing sessions and running programs can keep their previous environment. Reattaching to tmux or screen does not prove that a fresh login environment has been loaded. For system services, check their own environment configuration as well.
Run the following commands in the new session.
locale
locale charmap
The basic configuration is active when you see LANG=ko_KR.UTF-8, categories without an override use the Korean locale, and the character encoding is UTF-8. An empty value such as LC_ALL= is not an error: it means there is no global override. Use the locale command manual to interpret the actual environment.
Compare date formatting by printing the same date under two locales. These examples set the locale only for each command and do not modify the default configuration file.
LC_ALL=C date -d '2026-01-02' '+%A %B'
LC_ALL=ko_KR.UTF-8 date -d '2026-01-02' '+%A %B'
The first command should display English names, Friday January; the second should show the weekday and month names supplied by the installed Korean locale. Date formatting language and time zone are separate settings. If the time itself is incorrect, see how to set the time zone on Ubuntu 18.04 Server.
What to check when the setting does not take effect
- Locale warnings: Check whether
locale -alists the configured locale. If not, revisit package installation and locale generation. Adding a string to a file alone will not create missing locale data. - The file says Korean but the session uses another language: Examine LC_ALL, individual LC_* variables, and LANGUAGE in
locale. Also check for overrides in~/.profile,~/.bashrc, and/etc/environment. Change only the settings you need and log in again. - The language changes only over SSH: The client’s SendEnv and server’s AcceptEnv settings can pass LANG and LC_* values to the server. Compare the client locale with the locales generated on the server. See the OpenSSH client configuration and OpenSSH server configuration. Do not indiscriminately change remote access settings or restart SSH merely to fix a language mismatch.
- Only some messages remain in English: Check whether the program provides a Korean translation and inspect LANGUAGE. One English message does not mean that the entire locale configuration has failed.
- Korean appears as boxes or garbled text: Check the SSH terminal’s UTF-8 encoding and font support for Korean. Changing the server locale does not install fonts or a Korean input method on the client.
Restore the original configuration or switch to English
To return to the original state, restore the backup made before the change and log in again. This also restores any individual regional settings in the backup.
sudo cp -a /etc/default/locale.backup /etc/default/locale
cat /etc/default/locale
To select US English UTF-8 as a new default instead of restoring the old state, generate that locale and update the configuration. These commands also reset individual locale entries in the default file, so review any exceptions you need before running them.
sudo locale-gen en_US.UTF-8
sudo update-locale --reset LANG=en_US.UTF-8
After logging in again, verify with locale and locale charmap. If a different value still appears only over SSH, check user environment overrides and SSH forwarding settings rather than repeatedly overwriting the configuration from backup.




