Purging NVIDXIA *.run file driver installations from Rocky Linux
An Overview:
To remove an NVIDIA driver installed via a runfile installer on Rocky Linux ...
Use the built-in uninstaller for the installer.
- Locate the directory where the installer was run (often
/usr/local/cuda-X.Y/binfor CUDA installations). -
Execute the uninstaller script with root privileges.
Example:
sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller.
If the driver was installed by other means such as aRPM or a metapackage, use
dnf remove with the appropriate package names, such assudo dnf remove nvidia-driver.
After uninstallation, it may be necessary to clean up leftover files or configurations using
dnf autoremove and potentially manually removing files if the uninstaller does not detect and remove everything.
Procedure:
1. Identify the Installation Method:
- If a
.runfile ( such as the CUDA installer ) was used, anuninstall.shscript or a similar script will be found in the installation directory ( e.g.,/usr/local/cuda-X.Y/bin/cuda-uninstaller) . - If RPM packages were used, it will be necessary to identify the specific packages ( e.g.,
nvidia-driver,nvidia-settings,xorg-x11-drv-nvidia) and usednf remove.
2. Using the Runfile Uninstaller:
-
Navigate to the directory where the installer was run (e.g.,
/usr/local/cuda-X.Y/bin) . -
Execute the uninstaller script with
sudo:sudo /usr/local/cuda-X.Y/bin/cuda-uninstallerorsudo sh uninstall.sh. - Enter a password when prompted.
-
Identify the installed NVIDIA packages using
dnf list installed | grep nvidia. -
Use
sudo dnf remove <package_name>to remove them.For example:
sudo dnf remove nvidia-driver nvidia-settings.
This video shows how to use DNF to remove Nvidia drivers on Rocky Linux:
4. Cleaning Up:
dnf autoremove:After removing packages, runsudo dnf autoremoveto remove any orphaned dependencies.- Manual Cleanup:If the uninstaller or
dnfdoesn't remove all files, you might need to manually locate and remove remaining NVIDIA-related files and directories. You can use commands likefind /usr/lib -iname "*nvidia*"to search for them and then carefully delete them if needed. - Reboot:After uninstalling, it's often recommended to reboot your system to ensure that all changes are properly applied.
Important Considerations:
- Version Compatibility:Ensure that the kernel module and NVIDIA driver versions are compatible. You might need to reinstall the driver or kernel if there are mismatches.
- Backup:Before making significant changes, it's always a good idea to back up your system or create a system snapshot.
- Documentation:Refer to the official NVIDIA documentation for your specific driver and CUDA versions for the most accurate and up-to-date instructions.Purging NVIDXIA *.run file driver installations from Rocky Linux complete.
Related to
Comments
0 comments
Please sign in to leave a comment.