0

When I installed Ubuntu, I had a keyboard with the " above 2.

Later on, I changed my keyboard to one with EN-US layout with the @ above the 2 and changed my password in the terminal with the passwd command. The password was changed successfully, but when I open a terminal with CTRL+ALT+F1 and try to log in with my username and password, it says "login incorrect" unless I switch " and @. Then I can login.

Now my question is: Why is the keyboard layout different in the terminal than in other software?

Nmath
  • 12,333
Richie
  • 1
  • But now my password changed again with the @ to " again. I just tried to install some software and I had to use " again instead of @. I had to change it again in the terminal with the passwd command.I changed the keyboard layout in settings from English to US English. – Richie Jun 16 '19 at 23:11
  • What did you do to change the keyboard from UK to US? What you did may have had effect only for the GUI. – xiota Jun 17 '19 at 02:00
  • To help us help you, it would be good if you could edit your question and show us the output of these two commands: 1. cat /etc/default/keyboard 2. gsettings get org.gnome.desktop.input-sources sources – Gunnar Hjalmarsson Jun 17 '19 at 02:35
  • 1- $ cat /etc/default/keyboard

    KEYBOARD CONFIGURATION FILE

    Consult the keyboard(5) manual page.

    XKBMODEL="pc105" XKBLAYOUT="gb" XKBVARIANT="" XKBOPTIONS=""

    BACKSPACE="guess"

    – Richie Jun 17 '19 at 12:22
  • 2- $ gsettings get org.gnome.desktop.input-sources sources [('xkb', 'us')] – Richie Jun 17 '19 at 12:22
  • Hello, I get this anwer from Linuxbabe: Hi Richie, The classic terminal is technically called "virtual console" in the Unix/Linux world.

    The X11 graphical desktop environment has different keyboard configuration than the virtual console. You can type in the following command to see the keyboard configurations.

    localectl status

    By default, the virtual console keyboard mapping isn't specified. You can set keyboard mapping for the virtual console with the following command.

    sudo localectl set-keymap us

    – Richie Jun 17 '19 at 12:27

1 Answers1

1

You have XKBLAYOUT="gb" in /etc/default/keyboard, which determines the layout on the login screen and in console. The switch to "us" was only done for the desktop environment for your user.

So if you want "us" everywhere, then edit /etc/default/keyboard. You can either do it manually or by running the command:

sudo dpkg-reconfigure keyboard-configuration
Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94