14

I have an issue with my Ubuntu 18.04 Desktop system. I had installed virtualbox and vagrant and all was working fine. However, a couple days later, I opened my PC, reached to the login screen, but keyboard and mouse were not working at all. I restarted couple of times, but nothing.

I went to recovery mode and then to root shell. I tried doing:

sudo apt update
sudo apt upgrade
sudo apt update --fix-missing 
sudo add-apt-repository ppa:graphics-drivers/ppa

This gave this 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 doesn't exist" error on many commands. No resolv.conf file found.

One of the questions I found trying to solve my issue had an answer suggesting to use this command:

sudo apt purge nvidia-*

I ran this, and then it said to do:

sudo add-apt-repository ppa:graphics-drivers/ppa

Then the same error was shown:

cannot add PPA: 'ppa:~grahics-drivers/ubuntu/ppa'.
ERROR:'~graphics-drivers' user or team does not exist.

I rebooted the PC with init 5 and I was able to login, but now, after I login and the account opens, the keyboard and mouse are again not working. Now they are working only for login and mouse works before login only. Recovery mode console is getting of no use.

6 Answers 6

14

Maybe it is just because for some reason the Xserver module was removed. I fixed it by this:

  1. Press Ctrl+Alt+F1 to enter the TTY mode.

  2. Run:

    sudo apt install xserver-xorg-input-all 
    
3
  • 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
13

This is how I solved my issue:

  1. Reached the root shell and logged in by pressing the Shift key then selecting Advanced option.

  2. Pressed Ctrl+Alt+F2/F3/F4/F5. It asked for login details but nothing worked. It gave me this error:

    ERROR : ****** incorrect details. pam_nologin(8)
    
  3. Pressed Ctrl+D to close root shell and then selected clean, then dpkg, then network, and back to root. This time Ctrl+Alt+F3 worked.

  4. I was asked for login details and this time no error was shown.

  5. As I had purged my NVIDIA drivers, I ran these commands:

    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.

I don't know what had happened before, but this small weird error took me three days and good two nights to solve.

1
  • 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
7

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 by selecting 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. Run:

    cd /home/username
    
  7. Run:

    sudo apt install xserver-xorg-input-all
    
0

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.

0

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.

1
  • 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
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .