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.

settings-menu-wrench-tool

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.

universal-access

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.

on-screen-keyboard-menu

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.

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.

install-xserver

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.