in linux/cuda_installer/os_installers/dnf_system.py [0:0]
def _add_nvidia_repo(self):
"""
Add the Nvidia repository to the system. Do nothing if already done.
"""
system, version = self._detect_linux_distro()
assert system in (System.RHEL, System.Rocky)
version = version.split(".")[0]
repo_url = NVIDIA_RHEL_REPO_URL.format(version=version)
self.run(f"dnf config-manager --add-repo {repo_url}")
self.run("dnf clean all")