Device drivers literally drive everything you’re interested in–disks, monitors, keyboards, modems–everything outside the computer chip and memory. With the ubuntu-drivers command you can install the recommended driver for the device.
First, detect the model of your device and the recommended driver. To do so execute the following command. Please note that your output and recommended driver will most likely be different:
$ ubuntu-drivers devices == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == modalias : pci:v000010DEd00001C03sv00001043sd000085ABbc03sc00i00 vendor : NVIDIA Corporation model : GP106 [GeForce GTX 1060 6GB] driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-435 - distro non-free driver : nvidia-driver-440 - distro non-free recommended driver : xserver-xorg-video-nouveau - distro free builtin
If you agree with the recommendation feel free to use the ubuntu-drivers command again to install all recommended drivers:
$ sudo ubuntu-drivers autoinstall
Alternatively, install desired driver selectively using the apt command. For example:
$ sudo apt install [driver-name]
Once the installation is done, some drivers require you to reboot the system.
$ sudo reboot
If you get the below error while running the ubuntu-drivers command:
ubuntu-drivers: command not found
you may try installing the ubuntu-drivers-common package using the below command:
$ sudo apt-get install ubuntu-drivers-common