How do I change the system language to German in Ubuntu 16.04 via terminal?

17,276

Solution 1

From command line you can try this:

sudo apt-get install language-pack-de language-pack-gnome-de
sudo apt-get install $(check-language-support)
sudo update-locale LANG=de_DE.UTF-8

Then relogin or reboot.

Edit:

It seems from your error message that the English locale has not been created. So run this:

sudo locale-gen en_US.UTF-8

Then I'd recommend an extended update-locale command:

sudo update-locale LANG=de_DE.UTF-8 LANGUAGE= LC_MESSAGES= LC_COLLATE= LC_CTYPE=

Edit II:

To work around the weird settings of environment variables in /etc/lxdm/Xsession, try to open ~/.profile for editing and add this line to the bottom of it:

unset GREETER_LANGUAGE

Solution 2

There is no need for terminal to do this, open the 'System Settings' (This is for Unity desktop, for LXDE it is called 'Preferences') application which opens the following window:

enter image description here

Then click on 'Language Support' and you get another window opening and maybe as well get a reminder that the language support is not installed completely.

If that happens click on install which will then prompt you for your password and installs the missing language bits. You will end up in this following window where you can click on 'Install/Remove Languages' button and choose German.

enter image description here enter image description here

Click on 'Apply' to install German for the system. Afterwards click on 'Deutsch (Deutschland)' and move it up in the list to the top. Then click on 'Deutsch (Deutschland)' followed by 'Apply System-Wide'. you will then be prompted for your password again to make it happen.

enter image description here

All then is left before rebooting to set the 'Reginal Formats' to German too and as well 'Apply System-Wide'. To make this change happen you need to reboot.

After this you will get greeted by the following window on your first log in where you can choose to keep the old folder names in your home folder or to actualize them to German as well.

enter image description here

Both options will work, and its up to you to decide what you want there.

Solution 3

Finally, I found the answer. I have to follow the steps below.

sudo apt-get install language-pack-de language-pack-gnome-de
sudo apt-get install $(check-language-support)
sudo update-locale LANG=de_DE.UTF-8

Then mark off the comment in /etc/lxdm/Xsession:

# override ~/.profile if language was set on the greeter
if [ -n "$GREETER_LANGUAGE" ]; then
    language_list=${GREETER_LANGUAGE%.*}${GREETER_LANGUAGE#*.UTF-8}:en
    export LANGUAGE="$language_list"
    export LC_MESSAGES="$GREETER_LANGUAGE"
    export LC_CTYPE="$GREETER_LANGUAGE"
    export LC_COLLATE="$GREETER_LANGUAGE"
fi    

Afterwards your system will change to German.

Share:
17,276

Related videos on Youtube

Tsung-Li Wang
Author by

Tsung-Li Wang

Updated on September 18, 2022

Comments

  • Tsung-Li Wang
    Tsung-Li Wang almost 2 years

    I'm using Ubuntu 16.04 with LXDE desktop:

    Desktop

    I'm trying to change the language to German, but I'm not sure how.

    Any advice for me?

    • Thomas Ward
      Thomas Ward over 6 years
      Comments are not for extended discussion; this conversation has been moved to chat.
  • terdon
    terdon over 6 years
    Comments are not for extended discussion; this conversation has been moved to chat.
  • scones
    scones about 6 years
    language-pack-gnome-de is just for desktop tho.