Difference between revisions of "Locale settings Ubuntu"

From Teknologisk videncenter
Jump to: navigation, search
(Created page with "Debian based system like Ubuntu, then the following should work. If you haven’t already, install the locales module on your system. <source lang=bash> sudo apt-get install...")
 
m
 
Line 4: Line 4:
 
<source lang=bash>
 
<source lang=bash>
 
sudo apt-get install locales
 
sudo apt-get install locales
</aource>
+
</source>
 
Locate and edit the /etc/locale.gen file on your system. That will probably require administrator privileges. Find the locales you want to use, uncomment those lines and save.
 
Locate and edit the /etc/locale.gen file on your system. That will probably require administrator privileges. Find the locales you want to use, uncomment those lines and save.
  

Latest revision as of 07:30, 16 July 2024

Debian based system like Ubuntu, then the following should work.

If you haven’t already, install the locales module on your system.

sudo apt-get install locales

Locate and edit the /etc/locale.gen file on your system. That will probably require administrator privileges. Find the locales you want to use, uncomment those lines and save.

Alternatively, you can use sed to edit the lines in-place, like this,

sed -i 's/^# de_DE.UTF-8 UTF-8$/de_DE.UTF-8 UTF-8/g' /etc/locale.gen
sed -i 's/^# fr_FR.UTF-8 UTF-8$/fr_FR.UTF-8 UTF-8/g' /etc/locale.gen

for instance, to enable the French and German locale settings.

Run locale-gen to generate the locales you have chosen. For example, if you wish to have U.S. English, German and French enabled, you would do

locale-gen en_US.UTF-8 de_DE.UTF-8 fr_FR.UTF-8

Finally, update the locales. Here you don’t need to list them all, just the default one.

update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8

Links