How to Change the System Language and Locale on Rocky Linux
On Rocky Linux, use localectl to check or change the system-wide language and locale. If the Korean locale is unavailable, install glibc-langpack-ko, run localectl set-locale LANG=ko_KR.UTF-8, and then sign out and start a new login session.
sudo dnf install glibc-langpack-ko sudo localectl set-locale LANG=ko_KR.UTF-8
A locale controls more than translated messages. It can also affect date and number formats, collation rules, and character encoding. If consistent logs and automation output are more important than localized messages, consider keeping C.UTF-8 or en_US.UTF-8 instead of changing the server to Korean.
Check the current language and locale
localectl status locale
localectl status displays the system-wide locale and console keymap. The locale command shows the values actually applied to the current shell session, including LANG, LC_TIME, and LC_MESSAGES.
An existing login session can retain its old environment variables after the system setting changes. Check both commands when confirming whether a change has taken effect.
Find available locales
localectl list-locales locale -a
If the list does not contain the equivalent of ko_KR.UTF-8, install the Korean language pack.
sudo dnf install glibc-langpack-ko
For English locales, install glibc-langpack-en when necessary. Package availability can vary with the Rocky Linux release and enabled repositories, so check the package before installing it.
dnf info glibc-langpack-ko dnf provides '*/ko_KR*'
Change the system-wide default language
Set the system locale to Korean
sudo localectl set-locale LANG=ko_KR.UTF-8
localectl manages the system locale and normally writes the setting to /etc/locale.conf. The variables supported in that file are documented in the systemd locale.conf manual.
Set English or a neutral UTF-8 locale
sudo localectl set-locale LANG=en_US.UTF-8
An English locale can be convenient when troubleshooting documentation and log searches use English error messages. If the installed environment supports it, the language-neutral C.UTF-8 locale is also useful for automation servers.
Verify that the change is active
Sign out and sign in again, or open a new SSH session, before checking the result.
localectl status locale printf '%s\n' "$LANG"
A reboot is not normally required. However, a running service can keep the environment that it received when it started. If a service's locale matters, inspect its systemd environment configuration and restart the service safely when necessary.
Change the language for the current terminal only
Set an environment variable to change the locale for the current shell and its child processes without changing the whole system.
export LANG=ko_KR.UTF-8
To apply a locale to one command only, place the variable assignment before the command.
LANG=C.UTF-8 dnf info bash
These changes disappear when the shell exits. If a script requires predictable messages, sorting, or formatting, set the required locale explicitly in the script.
Understand LANG and LC_* precedence
| Variable | Purpose | Important consideration |
|---|---|---|
LANG |
Default locale when a category-specific variable is not set | This value is sufficient for most system-language changes. |
LC_MESSAGES |
Language used for program messages | It can change messages while preserving other date and number formats. |
LC_TIME |
Date and time representation | Scripts can fail when they parse localized date output. |
LC_ALL |
Overrides all other locale variables | It is useful for temporary diagnostics but should be used carefully as a persistent setting. |
If LC_ALL is set, changing LANG may not change the result.
env | grep -E '^(LANG|LC_)'
Troubleshoot broken Korean characters
- Confirm that the required UTF-8 locale appears in
locale -a. - Check that the SSH client and terminal emulator use UTF-8.
- Make sure the selected font contains Korean glyphs.
- Check whether the application has its own language or encoding setting.
- Verify that scripts and data files are actually saved as UTF-8.
Locale and font support are separate issues. Even with a Korean system locale, Korean text can appear as empty boxes if the terminal font lacks the necessary glyphs.
Frequently asked questions
Why did the current shell language not change after running localectl?
An existing shell retains the environment variables that it received at login. Sign out and back in, or start a new SSH connection, and then check the result with locale.
Should every server use a Korean system locale?
It depends on the operations team and automation requirements. An English locale or C.UTF-8 can be more convenient when you search for English error messages or need predictable script output.
Can I run only one command in English?
Yes. Prefix the command with a locale assignment, such as LANG=C.UTF-8 COMMAND. Use locale -a to confirm the exact locale names installed on the system.
Does changing the locale also change the keyboard layout?
No. The language locale and console keymap are separate settings. Check both in localectl status. The keyboard layout in a remote SSH terminal is usually controlled by the client operating system.
Summary
Install the required language pack and run localectl set-locale LANG=ko_KR.UTF-8 to change the default Rocky Linux locale to Korean. Verify the result in a new login session with both localectl status and locale.
On production servers, choose a locale only after considering message language, date and number formats, sorting rules, and automation behavior. Red Hat's system locale configuration documentation provides the underlying procedure used by Rocky Linux-compatible systems.









