How to Reinstall USB Mouse Drivers in Ubuntu Using the Command Line

By W. P. Wentzell

Ubuntu automatically detects and configures mouse and keyboard drivers to work with your system. However, some rare circumstances may require a complete reinstallation of these input device drivers to make them work properly. The system responsible for managing these input drivers is known as the "X.Org Server" (or "xorg"), the X windows system used in Linux. It is the base graphical environment for your computer under Ubuntu. Therefore, reinstallation of the xorg windows environment may be necessary to activate your USB mouse or keyboard.

Step 1

Boot your computer and log in.

Step 2

Press "CTRL + ALT + F1" simultaneously to gain access to a command-line console. Your screen will turn black and may prompt you for your login information. Log in using the text console if prompted.

Step 3

Enter the command "sudo apt-get remove --purge xserver-xorg" (without quotes) and hit "Enter." This completely purges the current xorg configuration.

Step 4

Enter the command "sudo apt-get install xserver-xorg" (without quotes) and hit "Enter." This installs a fresh xorg server.

Step 5

Reconfigure xorg by entering the command "sudo dpkg-reconfigure xserver-xorg" (without quotes).

Step 6

Reboot the computer and log in.

Step 7

Acces a command-line console again (see Step 2).

Step 8

Enter the command "sudo nano -B /etc/X11/xorg.conf" (without quotes) and hit "Enter." Enter your password at the prompt.

Step 9

Edit the xorg configuration file to make the following lines look like this:Option "Device" "/dev/ttyUSBx" (where "x" is the number of the USB port in use)Option "Protocol" "auto"

Step 10

Hold down the "Ctrl" key and hit "X." Ubuntu will then ask if you want to save the changes you made. Type "Y" and hit "Enter" to save the changes to the xorg configuration file. The USB mouse drivers are now installed.

Step 11

Enter the command "sudo /etc/init.d/gdm restart" (without quotes) to restart the X server. If your mouse still does not work, continue to Step 12 to undo these changes.

Step 12

Access a command-line console (see Step 2).

Step 13

Enter the command "cd /etc/X11" (without quotes), followed by "sudo cp xorg.conf~ xorg.conf" (without quotes). Your changes are now undone. Start over from Step 8 and try substituting a different number for the USB port (i.e., Option "Device" "/dev/ttyUSBx") in Step 9.