Simplifying NVIDIA driver installation on Ubuntu
Troubleshooting and Resolving Issues
If you were not greeted with something graphical but rather a blank screen, then it is likely that the package is not in fact suitable for your GPU and will need to be removed. Don't panic just yet, however. This is a fairly easy and straightforward process as well. Reboot, and at the GRUB loading screen, instead of choosing a normal boot into Ubuntu, choose Advanced Options for Ubuntu and then choose the Ubuntu, with Linux … (recovery mode) option. The … will show the kernel that you are running and you can select the most recent kernel here. Make sure to select the recovery mode option regardless.
Once in recovery mode you will want to choose root, with the description of Drop to root shell prompt. This will boot into a command line and from here you can get rid of the offending packages. Run the following to find out which NVIDIA packages are installed:
$ apt list *nvidia* --installed
Once you have seen what packages are there, you can use the following two commands in the following order to rid yourself of the NVIDIA packages. First use:
$ apt remove nvidia-driver-390 nvidia-settings nvidia-prime nvidia-dkms ... etc.
You will have many NVIDIA packages here, and listing all of them after the driver package itself with a space between them will remove all. This will get rid of dependencies and libraries so that when you try the next option you are starting from a clean slate. In the example above I listed a few of the packages that show up when I run the list
command, but there are about 20 or 22 of them in total. Once that is done, you will finalize the uninstallation by running the same but with purge
instead of remove
, ‡ la:
$ apt purge nvidia-driver-390 nvidia-settings nvidia-prime nvidia-dkms ... etc.
This gets rid of any settings and configurations that may still be lingering after removal of the packages themselves. You can also do a quick cleaning with the following command after all of that:
$ apt autoremove
just to be sure that you have gotten everything out of there that can be removed.
When this is complete, simply type reboot
and hit Enter to reboot the system. At this point you should see that the nouveau drivers are loaded and running instead of the proprietary NVIDIA ones. You can now try a different driver package by listing and installing as you did before, and I would recommend going to the next available lower number. In my experience most of the problems that I have had with installing NVIDIA drivers stem from the fact that my old cards aren't well supported on newer drivers, even though those newer drivers will show up when queried. Going to older available packages one at a time ensures that I have the most up-to-date set of packages available for my card which will run without problems.
Concluding Remarks
I cannot express the amount of frustration I felt as a beginner around installing one of these only to have a blank screen be the result upon reboot. At that time, my solution was a complete reinstall of the OS, at which point I would try to use the open source driver package with its faults or go to a different NVIDIA driver and cross my fingers and hope for better results. Yes, I have reinstalled Ubuntu more then four times simply trying to get a driver package that worked. That is exactly why I think it is important not only to be comfortable with the terminal and with using the recovery mode, but also simply to know a bit about what is happening under the hood. Now that I have a method for recovery upon failure and have some confidence that I can get my system back to a working desktop, I can say that I simply find it easier and faster to use the terminal for the entire process. The added benefit here in my opinion is that you can actually see what is happening in the terminal rather than waiting, guessing, and hoping with the GUI equivalent (Figure 4).
Hopefully one day we will see the NVIDIA gang team up with our beloved open source community to produce a non-proprietary solution with the performance and benefits of the closed source offering that currently exists. Until then I am afraid we are stuck with some of this hassle. Following the advice given above, however, you at least won't have to be stuck at a blank screen for too long after installing their solution onto your machine. I guess it really is as they say: You win some and you lose some.
Infos
- NVIDIA: https://www.nvidia.com/
- AMD Radeon graphics cards: https://www.amd.com/en/graphics/radeon-rx-graphics
- Ubuntu: https://ubuntu.com/
- Red Hat Enterprise Linux: https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux
- Fedora Linux: https://getfedora.org/
- Nouveau Xorg driver: https://launchpad.net/nouveau
- SteamOS and Linux titles: https://store.steampowered.com/linux
- Pop!_OS by system76: https://pop.system76.com/
- YouTube: Gaming on Linux is NOT Ready: https://www.youtube.com/watch?v=Rlg4K16ujFw
- NVIDIA Optimus technology: https://www.nvidia.com/en-us/geforce/technologies/optimus/technology/
- Intel GPUs: https://www.intel.com/content/www/us/en/products/discrete-gpus.html
- Supermicro X8STi: https://www.supermicro.com/products/motherboard/Xeon3000/X58/X8STi.cfm
- Dell Latitude E-Series laptops: https://www.dell.com/
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.
-
Plasma Desktop 6.1.4 Release Includes Improvements and Bug Fixes
The latest release from the KDE team improves the KWin window and composite managers and plenty of fixes.
-
Manjaro Team Tests Immutable Version of its Arch-Based Distribution
If you're a fan of immutable operating systems, you'll be thrilled to know that the Manjaro team is working on an immutable spin that is now available for testing.