Install Old NVIDIA Drivers on Linux – Step‑by‑Step Guide
In this article
Yes, you can install older NVIDIA drivers on a Linux system; you simply remove the current driver, select the legacy version that matches your GPU, and install it using the package manager or the official .run installer.
What You’ll Need
- A Linux distribution that uses the apt package manager (e.g., Ubuntu, Linux Mint, Pop!_OS). Other distributions follow similar principles but command syntax may differ.
- Administrative (sudo) privileges on the machine.
- Internet access to download packages or the driver archive from NVIDIA’s website.
- The exact model of your NVIDIA GPU (run
lspci | grep -i nvidiato see it). - Optional: A USB stick or another bootable medium in case the graphical session fails and you need to recover.
Step‑by‑Step
-
Identify the GPU and the driver series it belongs to. Run:
Look for a line such aslspci -k | grep -A 2 -i "VGA"Subsystem: NVIDIA Corporation GP107 [GeForce GTX 1050]. Older GPUs (pre‑Pascal) require thelegacyseries (e.g., 340.xx, 390.xx). Newer GPUs can use the regular470or515series, but you may still prefer an older release for stability. -
Check which driver versions are available in the repository. Execute:
The output will list packages likeapt search nvidia-drivernvidia-driver-340,nvidia-driver-390,nvidia-driver-470, etc. Note the exact package name for the legacy version you need. -
Stop the graphical display manager. The command differs by distro:
- Ubuntu with GDM:
sudo systemctl stop gdm - Ubuntu with LightDM:
sudo systemctl stop lightdm - Other: replace the service name with
display-manageror usesudo service dm stop.
- Ubuntu with GDM:
-
Remove any existing NVIDIA driver packages. Run:
This removes the current driver, its configuration files, and any automatically installed dependencies.sudo apt-get purge '^nvidia-.*' -
Blacklist the open‑source
nouveaudriver. Create or edit/etc/modprobe.d/blacklist-nouveau.confwith:
Then rebuild the initramfs so the blacklist takes effect:sudo bash -c "echo -e 'blacklist nouveau\noptions nouveau modeset=0' > /etc/modprobe.d/blacklist-nouveau.conf"sudo update-initramfs -u -
Install the chosen legacy driver. If you prefer the repository package, run:
Replacesudo apt-get install nvidia-driver-340340with the version you identified earlier. If the repository does not contain the exact legacy version, download the .run file from NVIDIA’s official driver archive.- Make the file executable:
chmod +x NVIDIA-Linux-x86_64-340.108.run - Run the installer in console mode:
sudo ./NVIDIA-Linux-x86_64-340.108.run --no-cc-version-check --no-nouveau-check - Answer the prompts – accept the license, let the installer create a new
xorg.conffile, and decline the DKMS module if you do not need automatic kernel updates.
- Make the file executable:
-
Re‑enable the display manager and reboot. Start the service again:
Then reboot to load the new kernel module:sudo systemctl start gdm # or lightdm, sddm, etc.sudo reboot -
Verify the driver is active. After the system restarts, run:
The command should display the driver version you installed, the GPU model, and usage statistics. If it reports “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver,” return to the troubleshooting section.nvidia-smi
Common Mistakes
- Attempting to install a legacy driver on a kernel that is newer than the driver supports. Legacy drivers often lag behind kernel releases; check the driver’s release notes for the maximum supported kernel version.
- Leaving the
nouveaudriver loaded. If the blacklist file is missing or the initramfs is not rebuilt, both drivers may conflict, resulting in a black screen. - Using the graphical package manager while the display manager is still running. The installer may fail silently because the X server holds the GPU.
- Skipping the
purgestep, which leaves old configuration files that can cause module mismatches. - Downloading the wrong architecture (e.g., 32‑bit driver on a 64‑bit system). Always verify the
x86_64label for modern PCs.
Tips
- Keep a copy of the original
xorg.conf(if one exists) before overwriting it. You can restore it withsudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.confif the new driver causes problems. - If you frequently switch between driver versions, consider using
update-alternativesto manage multiplenvidia-modprobebinaries. - For systems that use Secure Boot, you must either sign the kernel module yourself or disable Secure Boot in the BIOS; otherwise the driver will be blocked from loading.
- When using the .run installer, add the
--no-drmflag if you plan to use Wayland, as the legacy driver may not support the DRM kernel mode‑setting required by Wayland. - Document the exact driver version you installed in a text file (e.g.,
/etc/nvidia-driver-version) so future maintenance scripts can detect it.
Troubleshooting
If the system fails to boot into the graphical environment after installing an old driver, follow these steps in order of increasing impact.
- Restart and access a virtual console. Press
Ctrl+Alt+F2(or F3‑F6) at the black screen to get a text login prompt. - Check the driver load status. Run
lsmod | grep nvidia. If nothing appears, the module did not load. - Inspect the Xorg log. View
/var/log/Xorg.0.logfor lines containing “(EE)” which indicate errors. Common messages include “Failed to load module nvidia” or “No screens found”. - Re‑run the installer in safe mode. Boot into recovery mode (selected from the GRUB menu), choose “root” shell, and execute the installer with the
--no-kernel-moduleoption to only reinstall user‑space components. - Temporarily revert to the open‑source driver. Remove the NVIDIA packages again (
sudo apt-get purge '^nvidia-.*') and delete or rename/etc/X11/xorg.conf. Then reboot; the system should fall back tonouveauallowing you to recover the desktop. - Update the kernel or switch to a supported one. If the kernel is newer than the driver supports, install an LTS kernel that matches the driver’s compatibility list (e.g.,
sudo apt-get install linux-image-5.15.0-50-generic). - Disable Secure Boot. Enter the BIOS/UEFI setup, locate the Secure Boot option, and set it to “Disabled”. Save changes and reboot.
- Seek community help. Provide the output of
nvidia-smi,uname -r, and relevant log excerpts on forums such as Ubuntu Forums or the NVIDIA Linux Developer forums.
Frequently Asked Questions
Can I install an old NVIDIA driver on a laptop that uses Optimus?
Yes, but you must also install bumblebee or prime-select to manage the hybrid graphics. The legacy driver works only on the discrete GPU; the integrated Intel GPU remains untouched.
Do I need to reinstall the driver after every kernel update?
If you used the repository package, DKMS will rebuild the module automatically. When using the .run installer, you must rerun the installer after each kernel change because the module is not automatically recompiled.
Is it safe to use the 340.xx driver on a modern desktop with a 1080 Ti?
No. The 340.xx series supports GPUs up to the GeForce GTX 500 series. Newer cards require at least the 390.xx or newer series.
What if my system uses Wayland instead of Xorg?
Legacy NVIDIA drivers have limited Wayland support. The safest approach is to switch the session to Xorg (select “Ubuntu on Xorg” at the login screen) or use a newer driver that explicitly supports Wayland.
Will disabling Secure Boot affect other drivers?
Disabling Secure Boot only affects drivers that are not signed with a trusted key. Most open‑source drivers are unaffected; however, any third‑party kernel modules will also load without signature verification.
Can I keep two different NVIDIA driver versions installed simultaneously?
The package manager prevents co‑installation of conflicting driver packages. You can keep the .run installer of a previous version as a backup, but only one version can be active at a time.