Comment 26 for bug 1630245

From the top of my head:

1) In grub, select Advanced options, then recovery mode
2) Select "Drop to root shell"
3) Press Enter to confirm
4) The filesystem is mounted read-only at this point, so remount it: mount -o rw,remount /
5) Install the needed package: apt install xserver-xorg-input-all
6) Press Ctrl+D to leave the root shell.
7) Select resume boot from the menu.

Here are some more information regarding the recovery mode: https://wiki.ubuntu.com/RecoveryMode