According to this problem that I've encountered today: Locale not setting on Debian

I have solved my problem by running sudo apt-get install locales-all. But one question - what is sudo dpkg-reconfigure locales actually doing? Somebody said (somewhere else on the internet), that it is generating chosen locales. But for me - it wasn't doing anything. The locales were nowhere to be found on the system, thus those lines were popping up:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory

After running the command once again (sudo dpkg-reconfigure locales) - after installing them by apt-get install of course, and choosing en_US.UTF-8, a message popped up:

locales-all installed, skipping locales generation

Which is understandable. I have just downloaded a package with all of the locales. So why dpkg-reconfigure locales didn't generate it first?

1 Answer 1


I think I haven't done that before when I was initially solving this problem, but I think the thing is - I haven't uncommented certain locales in /etc/locale.gen. I guess this solution will work for some people in the future.

After uncommenting en_US locales (or any others that you would want to be generated) in that file (/etc/locale.gen), and using locale-gen command it has started generating those locales that I have uncommented. After doing that, I have checked dpkg-reconfigure locales and those locales that have been generated by locale-gen command were marked with an asterisk (*), which means they have been already generated.

So I guess you can do it that way, or just install all of the locales with apt.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .