Full switch locale: Ubuntu server installed with no locales, how to enable locales systemwide?
Solution 1
I have to investigate it deeper and this solution helps me to solve it:
dpkg-reconfigure locales
choose cs_CZ.UTF-8 UTF-8
(default) and/or en_US.UTF-8 UTF-8
apt-get install console-data
dpkg-reconfigure console-data
set pc / qwerty / Czech / Standard / Standard
or any other on your choice
dpkg-reconfigure console-setup
set Encoding to use on the console: UTF-8
set Charecter set: Latin2 - central Europe and Romanian, Fixed, 16
or any other on your coice
in file /etc/default/locale
set
LANG=cs_CZ.UTF-8
LANGUAGE=cs_CZ.UTF-8
LC_ALL=cs_CZ.UTF-8
LC_CTYPE=cs_CZ.UTF-8
I dont know which steps are necessary, but after this all fonts and especially all ftp transfers and all tar-gzip actions work well.
Solution 2
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:
LANG=en_US.UTF-8
Related videos on Youtube
Comments
-
Marilou over 1 year
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).
-
Mitch almost 11 yearsSee if thishelps.
-
Marilou almost 11 yearsL- partially, but still there is default "C" locale involved...
-
Marilou almost 11 yearsWhat about filenames? Still apears as ?????.txt
-
Gunnar Hjalmarsson almost 11 years(Did you reboot?)
-
Marilou almost 11 years@reboot: it is not possible without reboot? Actually, it is a server! And yes, unfortunate rebooted few times.
-
Gunnar Hjalmarsson almost 11 yearsSo, are the filenames showing up as ?????.txt UTF-8 encoded?
-
Marilou almost 11 yearsyes, actually, there is still LC_ALL=C, I will play wit that a while.
-
Marilou over 8 yearsit directs me right way, but as answer it is incomplete. So finally, I will giv -1