I want to switch to French locale. So I tried the below command:

myUbundu@myUbundu-desktop:~$ export LC_ALL=fr_FR

But I am getting the warning

-bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR)

How to set the locale to French? Do I need to install additional packages?


Try the following commands

sudo locale-gen fr_FR
sudo update-locale LANG=fr_FR
| improve this answer | |
  • 3
    sudo: locale-gen: command not found Do I need to install that tool? How? – dialex Aug 2 '17 at 10:48
  • @DiAlex without the ':' after sudo – infoclogged Aug 23 '17 at 22:45
  • 2
    @infoclogged He pasted the output indicating that he does not have the locale-gen installed. What is the package name for locale-gen is my question too. – dhill Oct 4 '18 at 14:59

I've had the same issue, and none of the answers worked, except dpkg-reconfigure locales. But it is too time consuming to do it this way. Just uncomment all the locales you need in /etc/locale.gen and run locale-gen. Or do it from the command line (as root):

echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen
| improve this answer | |
  • 3
    Contrary to the other answer this worked for me as well. – user643011 Dec 27 '17 at 1:17
  • Contrary to the accepted answer, this also worked for me (Ubuntu 16-04) though I just looked in the locale.gen file and uncommented the locales I wanted. – Dark Star1 Jan 8 '19 at 15:11

I have fought with this for a week or so.

The most reliable (and easiest too) for me was to edit my profile file with

gedit ~/.profile

An add this language variables to be set at every login


You need to log out and back in for the change to take effect.

| improve this answer | |
  • This also works from the command line, when you only want to change it for a certain time. – daniel kullmann Mar 31 '17 at 12:06

Try installing language pack for French, e.g.

sudo apt-get install language-pack-fr

For any other language, run: check-language-support -l CODE to check the supported packages, e.g.

$ check-language-support -l fr
firefox-locale-fr gimp-help-fr hunspell-fr language-pack-fr language-pack-gnome-fr thunderbird-locale-fr wfrench

Check also: LC_ALL: cannot change locale.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.