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.

More in This Category
How to Install MariaDB on Rocky Linux

How to Install MariaDB on Rocky Linux

Install MariaDB on Rocky Linux, enable the database service, complete the initial security setup, create a database and account, and verify access.

How to Install a GUI and Remote Desktop on Rocky Linux

How to Install a GUI and Remote Desktop on Rocky Linux

Install a graphical desktop on Rocky Linux, select the graphical boot target, configure remote access, and review firewall and security considerations.

How to Use DNF on Rocky Linux: Packages, Repositories, and Updates

How to Use DNF on Rocky Linux: Packages, Repositories, and Updates

Use DNF on Rocky Linux to search, install, remove, update, and inspect packages and repositories while keeping package-management changes controlled.

How to Manage firewalld on Rocky Linux: Zones, Services, and Ports

How to Manage firewalld on Rocky Linux: Zones, Services, and Ports

Learn how to manage firewalld on Rocky Linux with firewall-cmd, including active zones, services, custom ports, runtime and permanent rules, rich rules, and NetworkManager integration. The guide emphasizes a safe workflow for remote SSH servers.

How to Change the Hostname on Rocky Linux

How to Change the Hostname on Rocky Linux

Learn how to change a Rocky Linux hostname with hostnamectl, verify the persistent setting, and check name resolution and services afterward.

How to List Installed Packages on Rocky Linux

How to List Installed Packages on Rocky Linux

Use DNF and RPM to list, search, count, and inspect installed packages on Rocky Linux and identify which package owns a file.

How to Install PostgreSQL on Rocky Linux

How to Install PostgreSQL on Rocky Linux

Install PostgreSQL on Rocky Linux, initialize the database cluster, enable the service, create a database and user, and review network and authentication settings.

How to Configure SELinux Modes on Rocky Linux

How to Configure SELinux Modes on Rocky Linux

Check and change SELinux enforcing, permissive, and disabled modes on Rocky Linux, understand temporary and persistent changes, and troubleshoot denials safely.

How to Configure a Static IP Address on Rocky Linux

How to Configure a Static IP Address on Rocky Linux

Configure and verify a static IPv4 address on Rocky Linux with NetworkManager, including the gateway, DNS servers, connection profile, and safe remote-change checks.

How to Configure Root SSH Login on Rocky Linux Safely

How to Configure Root SSH Login on Rocky Linux Safely

Review how root SSH login is controlled on Rocky Linux, why direct root access is risky, and how to change and verify sshd settings without losing remote access.