How to Install NVIDIA GPU Drivers on Ubuntu 22.04: Complete Step-by-Step Guide
Learn how to fully install NVIDIA graphics drivers on Ubuntu 22.04, covering system updates, disabling Nouveau, removing old drivers, two installation methods (GUI and command line), verification steps, manual installation options, troubleshooting tips, and important precautions to ensure a stable GPU setup.
How to Install NVIDIA GPU Drivers on Ubuntu 22.04
1. Preparation
Update the system sudo apt update && sudo apt upgrade -y Disable the open‑source Nouveau driver Edit /etc/modprobe.d/blacklist.conf and add:
blacklist nouveau
options nouveau modeset=0Then run:
sudo update-initramfs -u
sudo rebootVerify with lsmod | grep nouveau (no output means disabled).
Remove old NVIDIA drivers
sudo apt purge nvidia-*
sudo apt autoremove2. Install NVIDIA Driver (Two Methods)
Method 1 – GUI
Open “Software & Updates”, go to the “Additional Drivers” tab, select the recommended proprietary driver, click “Apply Changes”, and reboot.
Method 2 – Command Line
Add the official PPA and update:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt updateList available drivers and pick 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 to display GPU model, driver version and CUDA version.
Check that the graphical desktop works without black screens or flickering.
4. Manual Installation (Optional)
Download the .run installer from the NVIDIA website.
Stop the display manager: sudo systemctl stop gdm3 # or lightdm Make the installer executable and run it without OpenGL or Nouveau checks:
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 and Fixes
Black screen or no GUI : Ensure the monitor is connected to the discrete GPU, disable Secure Boot in BIOS, or switch the display manager (e.g., sudo apt install lightdm && sudo dpkg-reconfigure lightdm).
Driver/kernel version conflict : Install build tools and kernel headers:
sudo apt install build-essential linux-headers-$(uname -r)Driver stops working after a system update : Reinstall the driver or run sudo apt install --reinstall nvidia-driver-535.
6. Precautions
Prefer the driver version recommended by Ubuntu to avoid compatibility problems.
Avoid running sudo apt upgrade after driver installation, as kernel upgrades may invalidate the driver.
Dual‑GPU users can switch modes with prime-select nvidia or prime-select intel.
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.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
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.
