How to change Linux language without reinstalling my OS
March 5, 2021
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:
To view the available language settings (locales), use the command
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:
Now you can see the new language settings (new locale) in the list of available locales.
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:
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
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:
- How to use Kali Linux to check web-sites (50%)
- How to run small Python code in Bash (50%)
- How to completely uninstall a package along with dependencies on Arch Linux (as well as BlackArch and Manjaro) (50%)
- Analogue of the --force option in pacman (50%)
- How to change the default operating system in Arch Linux (for UEFI and systemd-boot) (50%)
- Error “curl: (1) Received HTTP/0.9 when not allowed” (SOLVED) (RANDOM - 50%)