How to install graphics card driver in ubuntu

Installing graphics card driver in ubuntu

First step: first check if the graphics card driver is installed, run

glxinfo | head ,if it shows "direct rendering :Yes", then it is installed. If not, you can go to nvidia's website and download the appropriate drivers for your graphics card model and place them in your home directory.

Step 2: Remove the original driver package, run: sudo apt-get --purege remove nvidia-glx nvidia-glx-new, then remove /lib/linux-restricted-modules/2.6.31-14-generic/ (since the system may have been updated, the number after that may be different. (since the system may have been updated, the number after it may be different, just press the "TAB" key) The content with the word NVIDIA under the folder, here is the kernel driver, then check if these two files exist, /etc/init.d/nvidia-glx and /etc/init.d/nvidia-kernel. /nvidia-kernel, if they exist, delete them.

Step 3: Install the build environment

sudo apt-get install build-essential pkg-config xserver-xorg-dev linux-headers-`uname-r`

Step 4: Backup, run the following command

sudo cp /etc/default/linux-restricted-modules-common /etc/default/linux-common /etc/default/linux-restricted-modules-common.backup

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

Step 5: Disable the system from using the default driver with the following command

sudo gedit /etc/default/linux-restricted- modules-common

Add nv nvidia_new in double quotes at the end

Step 6: Press Ctrl+Alt+F1, log in and then stop the GDM process: sudo /etc/init.d/gdm stop ,and then go to the directory where the prepared driver is located (use the ls command to make sure that the file is not there)

sudo sh NVIDIA-linux-x86-173.14.22-pkg1.run

During the installation process, if you are prompted to remove old drivers, select YEs; if you are prompted for missing modules, ask if you want to download them from the Internet, select No; if you are prompted to change Xorg. conf, ask if you want to allow it, select Yes; the next step is to wait for the installation to complete

After that, go back to the terminal and restart GDM

sudo /etc/init.d/gdm start

.