Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] How do I change the system default language while keeping my keyboard layout?

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

[Solved] How do I change the system default language while keeping my keyboard layout?

#1 Post by hackphi »

Hi,

I'm new to Debian (12) and would like my system to be in English. However, I am using a German Keyboard and surprisingly, the installation process didn't let me combine English as a system language and a German keyboard layout so I had to go with German as overall language.

I found the option in the settings to change the language, but only German is offered. So I thought I probably need to install an English language pack but I can't find out how.

How hard can it be?

I am using the Cinnamon desktop.

Vielen Dank!
Last edited by hackphi on 2024-04-13 20:44, edited 2 times in total.

User avatar
Diesel330
Posts: 131
Joined: 2021-11-08 19:57
Location: Eastern Europe
Has thanked: 29 times
Been thanked: 19 times

Re: Language

#2 Post by Diesel330 »

You think that you choose language but Debian chose language for you. You might even think that you chose Debian but in fact Debian chose you and put this struggle on your way to test your character and your determination, to make you better

User avatar
fabien
Forum Helper
Forum Helper
Posts: 737
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 67 times
Been thanked: 173 times

Re: Language

#3 Post by fabien »

Hello, welcome to the forums!
hackphi wrote: 2024-04-09 20:10 I found the option in the settings to change the language, but only German is offered.
What is the output of locale -a when you type it in a terminal?
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

Re: Language

#4 Post by hackphi »

Diesel330 wrote: 2024-04-09 22:27 You think that you choose language but Debian chose language for you. You might even think that you chose Debian but in fact Debian chose you and put this struggle on your way to test your character and your determination, to make you better

Ha! I am the chosen one!
fabien wrote: 2024-04-10 10:54 Hello, welcome to the forums!
hackphi wrote: 2024-04-09 20:10 I found the option in the settings to change the language, but only German is offered.
What is the output of locale -a when you type it in a terminal?
I get this:

C
C.utf8
de_DE.utf8
POSIX

User avatar
fabien
Forum Helper
Forum Helper
Posts: 737
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 67 times
Been thanked: 173 times

Re: Language

#5 Post by fabien »

hackphi wrote: 2024-04-10 16:44 I get this:

C
C.utf8
de_DE.utf8
POSIX
OK, thanks. First, you need to add the English locale, for example en_US.UTF-8. To do this, you run dpkg-reconfigure locales as root in a terminal.
On the first page you keep your German locale and add an English locale (always choose a UTF8 locale).
The second page allows you to configure the default locale, there you choose the English one.

Then you run dpkg-reconfigure keyboard-configuration to reconfigure the keyboard layout if necessary.
Before that, it might be a good idea to save the original files for future reference:

Code: Select all

#> cp /etc/default/console-setup /etc/default/.console-setup.save
#> cp /etc/default/keyboard /etc/default/.keyboard.save
See the Locale page in the Debian Wiki for documentation, and also

Code: Select all

$> man 5 keyboard
It may take a bit of tinkering to get your exact configuration, the forum will provide you with resources on this. Let us know how it went.

Also consider changing the title of your first post to make it more specific, e.g.
How do I change the system default language while keeping my keyboard layout?
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

User avatar
sunrat
Administrator
Administrator
Posts: 6593
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 502 times

Re: Language

#6 Post by sunrat »

hackphi wrote: 2024-04-10 16:44
Diesel330 wrote: 2024-04-09 22:27 What is the output of locale -a when you type it in a terminal?
I get this:

C
C.utf8
de_DE.utf8
POSIX
Please use standard code tags for multiline output, not inline code tags. Inline tags are for a single command inside a sentence.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

Re: Language

#7 Post by hackphi »

How do I do that?

User avatar
sunrat
Administrator
Administrator
Posts: 6593
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 502 times

Re: Language

#8 Post by sunrat »

hackphi wrote: 2024-04-11 07:02 How do I do that?
Use the Code display button in the reply box. Or manually using "code" in the <> instead of "c" like you did.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

Re: Language

#9 Post by hackphi »

fabien wrote: 2024-04-10 20:51
hackphi wrote: 2024-04-10 16:44 I get this:

C
C.utf8
de_DE.utf8
POSIX
OK, thanks. First, you need to add the English locale, for example en_US.UTF-8. To do this, you run dpkg-reconfigure locales as root in a terminal.
Doing that produces the following error message in the language Debian has chosen for me:

Code: Select all

dpkg: Fehler: Aktionen -e (--control) und -r (--remove) stehen in Konflikt

Nutzen Sie dpkg --help für Hilfe zur Installation und Deinst. von Paketen [*];
Benutzen Sie »apt« oder »aptitude« für benutzerfreundliches Paketmanagement;
Nutzen Sie dpkg -Dhelp für eine Liste von Debug-Flags von dpkg;
Nutzen Sie dpkg --force-help für eine Liste von Optionen zum Erzwingen;
Nutzen Sie dpkg-deb --help für Hilfe zum Manipulieren von *.deb-Dateien;

Optionen mit [*] geben viel aus - schicken Sie es durch »less« oder »more«!
root@debian:/home/philipp# 

User avatar
fabien
Forum Helper
Forum Helper
Posts: 737
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 67 times
Been thanked: 173 times

Re: How do I change the system default language while keeping my keyboard layout?

#10 Post by fabien »

hackphi wrote: 2024-04-11 20:03 Doing that produces the following error message in the language Debian has chosen for me:
I was able to reproduce this error:

Code: Select all

#> LANG="en_US.utf8" dpkg -reconfigure locales
dpkg: error: conflicting actions -e (--control) and -r (--remove)

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
This is because the correct command is dpkg-reconfigure (one word), not dpkg -reconfigure.

Code: Select all

#> dpkg-reconfigure locales
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

Re: How do I change the system default language while keeping my keyboard layout?

#11 Post by hackphi »

fabien wrote: 2024-04-11 20:29
hackphi wrote: 2024-04-11 20:03 Doing that produces the following error message in the language Debian has chosen for me:
I was able to reproduce this error:

Code: Select all

#> LANG="en_US.utf8" dpkg -reconfigure locales
dpkg: error: conflicting actions -e (--control) and -r (--remove)

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' or 'aptitude' for user-friendly package management;
Type dpkg -Dhelp for a list of dpkg debug flag values;
Type dpkg --force-help for a list of forcing options;
Type dpkg-deb --help for help about manipulating *.deb files;

Options marked [*] produce a lot of output - pipe it through 'less' or 'more' !
This is because the correct command is dpkg-reconfigure (one word), not dpkg -reconfigure.

Code: Select all

#> dpkg-reconfigure locales
Well then it says (in German): "command not found". There, it makes no difference if I'm root or not.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 737
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 67 times
Been thanked: 173 times

Re: How do I change the system default language while keeping my keyboard layout?

#12 Post by fabien »

hackphi wrote: 2024-04-13 09:29 Well then it says (in German): "command not found". There, it makes no difference if I'm root or not.
dpkg-reconfigure is part of the debconf package which is mandatorily installed. It is located in /usr/sbin/, you can test with

Code: Select all

$> ls /usr/sbin/dpkg-reconfigure
/usr/sbin/dpkg-reconfigure
Therefore, I assume you are not properly logging in as root, resulting in an incorrectly set PATH. You need to use su -, not just su so that /usr/sbin/ is in your PATH.

Code: Select all

$> su
Password:
#> echo "$PATH"
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
#> command -V dpkg-reconfigure 
bash: command: dpkg-reconfigure: not found
#> exit
$> su -
Password:
#> echo "$PATH"
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#> command -V dpkg-reconfigure 
dpkg-reconfigure is /usr/sbin/dpkg-reconfigure
ImageShare your Debian SCRIPTS
There will be neither barrier nor walls, neither official nor guard, there will be no more desert and the entire world will become a garden. — Anacharsis Cloots

hackphi
Posts: 7
Joined: 2024-04-09 10:41
Has thanked: 2 times

Re: Language

#13 Post by hackphi »

fabien wrote: 2024-04-10 20:51
hackphi wrote: 2024-04-10 16:44 I get this:

C
C.utf8
de_DE.utf8
POSIX
OK, thanks. First, you need to add the English locale, for example en_US.UTF-8. To do this, you run dpkg-reconfigure locales as root in a terminal.
On the first page you keep your German locale and add an English locale (always choose a UTF8 locale).
The second page allows you to configure the default locale, there you choose the English one.
Ok, thanks. I was now able to do that after "properly" becoming root as explained in the last post.

The first step was all that was needed. I saw that my keyboard layout was still German afterwards (as I wanted it to be). I then restarted the system and it was in English, except my standard folders didn't get renamed, which is ok for me. Key layout was German after restart also. Bash is also giving me error messages in English now.

Thanks again, guys!

Post Reply