Recently, I updated my Ubuntu from 17.10 to 18.04 and after the reboot, the keyboard stopped working. It works on the lock screen, but not once I am logged in. Turns out, this is a fairly common problem. The keyboard input driver breaks after every major update, which causes miscommunication between the Ubuntu OS and the input devices.
You can easily fix this by installing the input X Server’s driver again. But since the keyboard is not working in the first place, this gets a bit tricky. And no, the external USB keyboard doesn’t work as well. So, here is how you fix the keyboard not working after updating your Ubuntu.
Fix keyboard not working in Ubuntu 18.04
Case 1: Keyboard and Mouse both working on Lock Screen
In this case, you have the keyboard and trackpad both working on the lock screen, you can directly launch a terminal session by pressing Ctrl + Alt + F3 and skip to this step.
Case 2: Keyboard not working but Mouse working on Lock Screen
Step 1: In this case, log in to the system with the help of the screen keyboard. You can enable it by clicking on the Accessibility or Human icon on the top-right corner. Once you are logged in, we need to once again turn on the screen keyboard. For that, open the Settings menu by clicking on the arrow at the top-right corner. Next, click on the gear icon from the extending menu.
Read: 3 Ways To Setup Static IP Address in Ubuntu
Step 2: In the Settings menu, click on “Universal Access” on the left-hand tab to go to the Hearing and Typing menu.
Step 3: On the Universal Access menu, navigate to the Typing menu. Click on the slider beside the “Screen Keyboard” text to the on the on-screen keyboard.
Step 4: Now that we have the on-screen keyboard, we need the terminal to run the command. To open the terminal, right-click on the Desktop and select Open Terminal.
Step 5: Once you have the terminal launched, type the following command and hit Enter.
At times Ubuntu might try to go fanatical and prompt you for the password even after entering sudo. Just use the on-screen keyboard to enter the password.
sudo apt-get install xserver-xorg-input-all
It should again prompt for input, press Y and hit Enter again.
Once after we have the X Server keyboard input drivers installed, reboot your System. When the system is back up and running, you should be able to use your keyboard and mouse.
Case 3: Keyboard and Mouse both not working
In case, the keyboard, trackpad, and mouse all are not working for you even on the lock screen, we need to launch the terminal during boot itself. To do that force shutdown the system with the physical keys.
While, the system is starting up, hold down the Shift key after the BIOS load and you will enter the GRUB menu. On the GRUB menu, press “e” to edit boot options. Search for the line which looks like the following.
linux /boot/vmlinuz-4.18.0-25-generic root=UUID=a98c605-2ac4-4ee3-8070-2560255293fe ro quiet splash $vt_handoff
Insert “/bin/bash” before $vt_handoff and press Ctrl + X or F10 to reboot. Once you in the command, run the following command and reboot back the system again.
sudo apt-get install xserver-xorg-input-all
Upon reboot, you should have the keyboard and mouse working for you.
Changing the GRUB file is a temporary change and not persistent. So if the boot crashes, just restart the system and it should be back to normal.
Wrapping Up
Ubuntu is a good free operating system to switch to if you don’t want to spend on a Windows license. However, Ubuntu has its own set of problems which take a while to fix. Read our other articles on 15 must-have apps on Ubuntu right after a fresh install and how to run Linux on Windows with a virtual box.
Let me know in the comments below in case of any issues or queries.
ray — you are by far the best I have ever encountered when dealing with my Ubuntu problems. By best, I mean: Precise and clear while providing straight and simple solutions.
Thanks very much.
I forgot to add “that work.”
Hi, thanks a lot for the post! I am facing this problem (keyboard not working, but the muse does). I tried to follow your instruction but I cannot pass the login screen. I enabled the onscreen keyboard but actually nothing happens. There is no keyboard showing up in the screen, not even when I touch the pass field. Therefore I tried the last option: I go to the Grub, press “e” and add the “/bin/bash”, but when I reboot nothing happens (no command line, just directly to the login screen). Any idea of what else could I do in this case?
Thanks!
I missed that entire line! So instead I went to advanced options, recovery mode, and enable network followed by dropping into root terminal. Here I was able to follow these instructions and whatever else you would like to do in terminal.
This worked for me. Thanks.
Still logitech keyboard not working but mouse is.
Thank you very much, you saved my day
How is this working some of my keys act differently like arrow key working as home and end, y key is working as taking screenshot, space bar is not working even in grub i am getting same problem.
By following your advice on fixing ‘keyboard not working’, I can complete all the steps. After rebooting, ‘on screen keyboard’ is enable but the keyboard is still not working.
At least I can use ‘on screen keyboard’ as a get around solution. Thanks for your advice.
thanks a lot. the second case and solution worked for me
I have tried everything listed and have the keyboard on the screen but cannot type anything into the terminal nor does the on-screen keyboard type any characters in Grub, the Terminal or anywhere else. I even tried an external keyboard with the same results.
Got the screen keyboard working to enter my login in the password but the ‘Enter’ key did not seem to work nor did the backspace. I’m using ubuntu on a remote hard drive on an old Dell XPS where the windows hard drive had died.
A full cold start seemed to fix that problem with the Enter Key
I replaced my keyboard (Dell Latitude E5570) and now have even more keys not working (u,i,o,h,j,k,l,n,m,comma, period). I am typing this with an external keyboard, which does work (clearly). What else could this possibly be?
I am not able to fix the error , updated my touchpad using terminal and after that i rebooted after that my keyboard and mouse both are not working plsss help 😭
I also have problems with the keyboard.
My PC:
HP EliteDesk 800 G2 SFF
Ubuntu 20.04.3 LTS
Keyboard: Microsoft Wireless Keyboard 2000
The last line after executing the command: “sudo apt-get install xserver-xorg-input-all”:
“0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.”
Installing xserver does not work for me. Uninstalled and installed several times already, still nothing. USB keyboard works fine, though
I have the third case where both keyboard and mouse are not working. I tried adding /bin/bash but this resulted in a normal boot. I then accessed the terminal through recovery mode but when I try to install xserver I get “Failed to Fetch” errors. I tried several things to resolve this but keep getting the same error. Is there anything else I can try to fix this?
Hi,
I tried the fix you suggested but it does not seem to work for me. While I followed the steps as you mentioned, it did not return any error. However, when Ubuntu boots and reaches the login menu, the keyboard and mouse does not work. Is there any other way to get them both working again? I am using a Dell Precision Tower 5810 with external keyboard and mouse.
Thanks.
Saved my life. Suddenly all input devices stopped working and i was about to believe it was a hardware problem on mainboard until i ran into your page. Thank you, whoever youu are!
To clarify, my mainframe laptop was unresponsive to mouse, keyboard, touchpad , but thankfully i could remotely use mouse and keyboard via VNC. So i opened a terminal and typed the magic line.
Man i wish you the best, you saved me. I have exams, and this happen to me. I couldn’t move the mouse or anything in linux 5.19.0-35… god bless you
some times my key board is not working after login my machine,mouse is working,screen key board,s Enter key does not work,after several restarts the machine the USB key board is working, This problem is faced since upgraded to ububtu 23.04, Is there any solution? or have to reinstall again, Please I am awaiting your advice
I recently experienced the same issue after removing xserver-* packages. However to my utter nightmare, when I tried above steps of installing xserver-xorg-input-all from recovery /bin/bash (following the steps told above), as I did not have network access, it failed to fetch… (again as mentioned in Note). I then tried to connect to network from recovery menu, which did not work, and in order to do the same, I ran into several issues, eventually corrupting boot…
1. I was stuck with “emergency mode ” where systemctl reboot/default did not work anymore…
2. I could not ran command “fsck -f /dev/sda*” (this sda* is root), as it gave /dev/sda* mounted… e2fsck : aborting… which meant I cannot fsck from the mounted disk
3. Finally I realised I need to fsck to /home, for that I ran “df” to find the device for /home
4. Then “fsck -f /dev/sda*” (this sda* /home) show corrupted inodes and asked whether to fix
5. I continued to fix as he console asked for… and upon finish I did systemctl reboot and bingo!
6. However, the real issue (no access to keyboard and mouse) remained same, so this time I tried to login to “tty2” from lockscreen (I knew I require network access to install packages) using ctrl+alt+F2, logged in, and then ran sudo apt install xserver-xorg-input-all
7. This time it worked and problem was finally resolved
8. If problem still persists, it is best to run sudo apt install –reinstall gdm3 ubuntu-desktop gnome-shell to reinstall everything once again (this also works if one loses ubuntu desktop as well)
Hope my steps helps/gives hint someone.