EDIT: just ask me info and i will give it to you. but someone pleas help me. i just cannot format this system. i did a lot this time to make it workable according to my work environment.please "

i am on my windows laptop now, THE ISSUE IS IN MY DESKTOP UBUNTU 18.04. i know there are tons of duplicate questions for this and yes i tried around 20 of them and none or nothing or no command is working.

i installed virtualbox and vagrant . all was working fine.

went to sleep . woke up next day. i mean three days back and started my pc with only ubuntu 18.04 installed . reached to the login screen. keyboard and mouse not working at all. restarted couple of times . nothing.

so i checked and checked for hours online.

went to recovery mode and then to root shell. tried doing sudo apt update sudo apt upgrade sudo apt update --fix-missing sudo add-apt-repository ppa:graphics-drivers/ppa *** this gave error.

cannot add PPA: 'ppa:~grahics-drivers/ubuntu/ppa'. ERROR:'~graphics-drivers' user or team does not exist. I got this same user or team doesnt exist error on many commands. no resolv.conf file found.

***** one of the questions even had answer to purge nvidia-* which i did and then said to do sudo add-apt-repository ppa:graphics-drivers/ppa and then it game the same error. cannot add PPA: 'ppa:~grahics-drivers/ubuntu/ppa'. ERROR:'~graphics-drivers' user or team does not exist.

******rebooted the pc.....with init 5 and i was able to login.

***** but now after i login and the account open.....the keyboard and mouse again not working.

**** now its working only for login and mouse mouse before login only.

***** recovery mode console or terminal is getting of no use.

6 Answers 6


this is now i solved my issue.

  1. reached the root shell and logged in by pressing shift key then selecting advanced option.
  2. pressed ctrl + alt + f2/f3/f4/f5 .it asked for login details but nothing worked. gave me this error: ERROR : ****** incorrect details. pam_nologin(8)
  3. ctrl + d to close root shell and then click clean then dpkg then network and back to root . this time it worked ctrl + alt + f3.
  4. asked for login details and this time it did not give me this error: ERROR : pam_nologin(8) kind of error. i was able to login to user terminal.
  5. as i had purged my nvidia drivers. i did these things :

6. sudo add-apt-repository ppa:graphics-drivers/ppa sudo ubuntu-drivers devices sudo ubuntu-drivers autoinstall #this installed nvidia-418 for me on its own. sudo apt-get update --fix-missing sudo apt-get install xserver-xorg-input-all sudo apt-get update && sudo apt-get upgrade -y sudo shutdown -r now this is to shutdown and restart.

IT WORKED. i was able to login to my system and then still the keyboard and mouse was working and i checked the graphics card info. it was the latest driver. dont know what had happened before. but this small weird error took my three days and good two nights.

  • 5
    for me it worked in quite a different way: in step2 I chose network and then typed: sudo apt-get install xserver-xorg-input-all, then rebooted and everything works! Hope that helps someone! Jan 24, 2020 at 19:25

maybe it is just because of Xserver module lost,I fix it by this: Ctrl + Alt + F1 into the tty mode and

 sudo apt install xserver-xorg-input-all 
  • 1
    It worked for me too! I just removed the old graphic card (Nvidia) and inputs where not working. After restoring the i915 driver, the display worked but inputs didn't. Installing xserver-xorg-input-all fixed it! Thanks for the tip
    – funder7
    Jun 1, 2020 at 11:39
  • 3
    This worked for me on 18.04.
    – Whome
    Jul 30, 2020 at 3:56
  • 3
    Worked nicely, during reboot jumped into root mode and sudo apt install xserver-xorg-input-all. mouse and keyboard start working
    – Lav Patel
    Sep 10, 2020 at 22:46

Not enough reputation to write this in a comment, but in case someone has trouble following the steps in the select answer, this is what I had to do:

  1. Get to the Grub page (turn on computer and press Escape (in UEFI) or Shift (in BIOS) after you see the maker logo)
  2. Select "Advanced options for Ubuntu"
  3. Enter the Recovery Menu (select Ubuntu, with Linux-xxx (recovery mode))
  4. You might need to select "network" to make sure you are connected to the internet
  5. Select root
  6. Do cd /home/username
  7. Do sudo apt install xserver-xorg-input-all

Previously CUDA only supports Ubuntu 18.04.1 but not 18.04.2. I got similar problems to yours when I tried to install CUDA on Ubuntu 18.04.2. However, I just found that Ubuntu 18.04.2 is now officially supported. You may give it a shot again using the latest CUDA.


This is not the most elegant solution to the problem, but maybe it saves someone's time.

None of the solution I found here or on the Internet helped. So I tried to upgrade to Ubuntu 20.04 with the command

sudo do-release-upgrade

and the issue resolved itself. Before you try it, make sure to backup your system.

  • As ridiculous as it may seem, this one worked for me. I got "keyboard and mouse not working" problem after some seemingly successful run of apt upgrade. Usual answers like apt install xserver-xorg-input-all didn't help, so I tried this one... and I was planning to upgrade entire system anyway :) To be exact, I didn't run do-release-upgrade, but apt dist-upgrade instead. So, same concept, different command. Thank you :)
    – pstryk
    May 16, 2022 at 21:45

I tried this solution, but it didn't work. Later I realized I had another issue. I realized that right after login I was stuck on Activities and it wasn't keyboard neither mouse issue (touchpad somehow was disabled using Fn+F10).

Stuck on activities (right after login) issue

  1. Ctrl+Alt+F3
  2. Login and run:
    killall -3 gnome-shell
  3. Return to the graphic tty: Ctrl+Alt+F2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.