Ubuntu – Full switch locale: Ubuntu server installed with no locales, how to enable locales systemwide


I have a server with no X, installed with no locales. There is a "C" locale.

I need to:

  • run server scripts (no console involved) to copy, move and gzip files towards local ext4 file-system, which should contain files with special encoding (Czech, Korean, Russian etc.), so the UTF-8 should be enabled.
  • see the file-names when I type commands in the console
  • have possibility to type most of the file-names with special letters, when logged trough ssh.

What should I do to reach that state? Goal is to give complete guide to change locale systemwide (as default).

Best Answer

I would generate the English (United States) locale.

sudo locale-gen en_US.UTF-8

The system wide locales are stated in /etc/default/locale in Ubuntu, so give that file the contents:

Related Question