Reinstalling Nvidia Drivers on Rocky 8.10

Hello, I encountered an issue today with the Gnome Software Center. When trying to do dnf update from the terminal, I was getting:

Error:
Problem: package nvidia-open-3:560.28.03-1.noarch from cuda-rhel8-x86_64 conflicts with kmod-nvidia-latest-dkms provided by kmod-nvidia-latest-dkms-3:560.28.03-1.el8.x86_64 from @System

  • cannot install the best update candidate for package kmod-nvidia-latest-dkms-3:560.28.03-1.el8.x86_64
  • cannot install the best update candidate for package cuda-drivers-3:560.28.03-1.x86_64

I accidently ran this command:

sudo dnf remove kmod-nvidia-latest-dkms
sudo dnf upgrade

How can I re-install nvidia drivers. I am using a Lenovo Thinkstation P330 Tiny using a Quadro P620. I really appreciate any help!

was able to fix using:

Remove existing NVIDIA packages

sudo dnf remove ‘nvidia

Add NVIDIA repository (if not already added)

sudo dnf config-manager --add-repo=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

Clean dnf cache

sudo dnf clean all

Install NVIDIA driver and necessary packages

sudo dnf install nvidia-driver nvidia-settings nvidia-driver-libs nvidia-driver-cuda

Load NVIDIA kernel module

sudo modprobe nvidia

Verify installation

nvidia-smi

and then i also needed to:

sudo dnf config-manager --disable cuda-rhel9-x86_64
sudo dnf config-manager --add-repo=https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo

I was able to solve it just by removing cuda which is just for development apparently

Description  : Meta-package containing all the available packages required for native CUDA
             : development. Contains the toolkit, samples, driver and documentation.