How to Install NVIDIA Drivers on Ubuntu 22.04: Complete Step‑by‑Step Guide
This guide walks you through preparing your Ubuntu 22.04 system, disabling the Nouveau driver, removing old NVIDIA packages, and installing the latest NVIDIA driver using either the graphical Software & Updates tool or command‑line methods, followed by verification and troubleshooting tips.
Ubuntu 22.04 NVIDIA Driver Installation Guide
1. Preparation
Update the system Ensure all packages are up‑to‑date: sudo apt update && sudo apt upgrade -y Disable the open‑source Nouveau driver Edit the blacklist file: sudo nano /etc/modprobe.d/blacklist.conf Add at the end:
blacklist nouveau
options nouveau modeset=0Update initramfs and reboot:
sudo update-initramfs -u
sudo rebootVerify with lsmod | grep nouveau (no output means success).
Remove old NVIDIA drivers (if any)
sudo apt purge nvidia-*
sudo apt autoremove2. Install NVIDIA Driver (two methods)
Method 1: Ubuntu Software & Updates (beginner friendly)
Open Software & Updates .
Switch to the Additional Drivers tab.
Select the recommended proprietary NVIDIA driver.
Click Apply Changes , wait for installation, then reboot.
Method 2: Command‑line (recommended)
Add the official graphics‑drivers PPA and update:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt updateList available drivers and note the one marked “recommended” (e.g., nvidia-driver-535): ubuntu-drivers devices Install the chosen driver: sudo apt install nvidia-driver-535 Reboot the system:
sudo reboot3. Verify Installation
Run nvidia-smi – it should display GPU model, driver version, and CUDA version.
Check that the graphical desktop works without black screens or flickering.
4. Manual Installation (for specific driver versions)
Download the .run installer from the NVIDIA website.
Stop the display manager (e.g., sudo systemctl stop gdm3 or lightdm).
Make the installer executable and run it without OpenGL files:
sudo chmod +x NVIDIA-Linux-x86_64-*.run
sudo ./NVIDIA-Linux-x86_64-*.run --no-opengl-files --no-x-check --no-nouveau-checkReboot:
sudo reboot5. Common Issues & Solutions
Black screen / no GUI
Ensure the monitor is connected to the discrete GPU port.
Disable Secure Boot in BIOS.
Switch display manager:
sudo apt install lightdm
sudo dpkg-reconfigure lightdmDriver‑kernel version conflict
sudo apt install build-essential linux-headers-$(uname -r)Driver breaks after kernel update
sudo apt install --reinstall nvidia-driver-5356. Precautions
Prefer the system‑recommended driver to avoid compatibility problems.
Avoid running sudo apt upgrade after installation unless you reinstall the driver, as kernel upgrades may invalidate it.
For dual‑GPU laptops, use prime-select nvidia to switch to the discrete GPU or prime-select intel for the integrated one.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
