Problem upgrading from CUDA 10 to CUDA 12 in centos 7

Following a conflict problem during installation of latest CUDA version from 10.1 using: “sudo yum install nvidia-driver-latest-dkms”:

Error: nvidia-driver-branch-440 conflicts with 3:nvidia-driver-latest-dkms-545.23.08-1.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

I found a possible work-arround in this web: Trying to upgrade from 418 tries to pull in both 440 and 465 creating conflicts. · Issue #20 · NVIDIA/yum-packaging-precompiled-kmod · GitHub . However, “sudo yum install nvidia-driver-latest-dkms cuda-drivers” prompts:

warning: /var/cache/yum/x86_64/7/cuda/packages/nvidia-driver-latest-dkms-devel-545.23.08-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d42d0685: NOKEY
Retrieving key from http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/7fa2af80.pub
The GPG keys listed for the “cuda” repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Failing package is: 3:nvidia-driver-latest-dkms-devel-545.23.08-1.el7.x86_64
GPG Keys are configured as: http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/7fa2af80.pub

I have tried unsuccessfuly to install the key with: “rpm --import 7fa2af80.pub” and “cat /etc/yum.repos.d/cuda-rhel7.repo” outputs:

[cuda-rhel7-x86_64]
name=cuda-rhel7-x86_64
baseurl=Index of /compute/cuda/repos/rhel7/x86_64
enabled=1
gpgcheck=1
gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/D42D0685.pub

also, “ls -lh /etc/pki/rpm-gpg”:
-rw-r–r–. 1 root root 1.7K Nov 23 2018 RPM-GPG-KEY-CentOS-7
-rw-r–r–. 1 root root 1004 Nov 23 2018 RPM-GPG-KEY-CentOS-Debug-7
-rw-r–r–. 1 root root 1.7K Nov 23 2018 RPM-GPG-KEY-CentOS-Testing-7
-rw-r–r-- 1 root root 1.7K Sep 4 2021 RPM-GPG-KEY-EPEL-7

What did I miss? Can anyone please give me any suggestion? I would be keen to remove all previous verions of CUDA if it is neccessary, although I think that the problem with the keys will still not be solved.

Thanks in advance:

Luis