Loading...
X

How to change Linux language without reinstalling my OS

When installing Linux, you can select the system language (locale) - and in the future this language will be used in Linux programs and windows (except for those applications for which no translation has been made).

If you decide to change the Linux language, then you do not need to reinstall it - just follow the simple steps.

To find out the current language settings, type the command:

locale

Output example:

To view the available language settings (locales), use the command

locale -a

To change the system language, it is necessary that the locale to which you want to change the language is already present in the system. If it is not there, then you need to add it.

To add a new locale, open the /etc/locale.gen file:

sudo gedit /etc/locale.gen

And uncomment the lines with the desired new locales there. Then run the command:

sudo locale-gen

Now you can see the new language settings (new locale) in the list of available locales.

locale -a

Changing the locale for the current session

To change the language for the current session, you need to set the LANG environment variable, this can be done with the export command:

# Set English locale
export LANG=en_US.UTF-8

# Set the Russian locale
export LANG=ru_RU.UTF-8

# Set the French locale
export LANG=fr_FR.UTF-8

If this did not work on your system, then replace the LANG variable with the LANGUAGE variable, for example:

export LANGUAGE=en_US.UTF-8

Change language settings permanently for one user

Add a line with the export of the desired locale (for example, “export LANG=en_US.utf-8”) to the ~/.bashrc file

The changes will take effect after logging out/logging in and will take effect after every reboot.

Changing the default system locale

There are two alternative methods for changing the locale.

The first is to run the following command (specify the locale you need):

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

Or:

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

The second method is to register the language in the /etc/locale.conf file, open it:

sudo gedit /etc/locale.conf

and add the line with the desired locale there:

LANG=en_US.utf-8

Leave Your Observation

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