Problem installing nvidia drivers debian

I had issues getting cuda to work on a debian distro.
I’ve tried several driver versions but seem to have messed something up. I can succesfully run

sudo apt-get remove --purge nvidia-*

but when trying to install the latest driver I get this message:

root@Server:~# aptitude install nvidia-driver-430
The following packages have unmet dependencies:
 nvidia-kernel-common-430 : Conflicts: nvidia-kernel-common but 20151021+4 is to be installed
 xserver-xorg-video-nvidia-430 : Depends: xserver-xorg-core (>= 2:1.19.6-1ubuntu2~) but 2:1.19.2-1+deb9u5 is to be installed
 nvidia-installer-cleanup : Conflicts: nvidia-driver-binary which is a virtual package, provided by:
                                       - xserver-xorg-video-nvidia-430 (430.14-0ubuntu0~gpu19.10.1), but 430.14-0ubuntu0~gpu19.10.1 is to be installed
                                       - xserver-xorg-video-nvidia-418 (418.74-0ubuntu1), but it is not going to be installed

The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     nvidia-dkms-430 [Not Installed]
2)     nvidia-driver-430 [Not Installed]
3)     nvidia-kernel-common-430 [Not Installed]
4)     xserver-xorg-video-nvidia-430 [Not Installed]

Any idea what I can try to make it work? Reinstalling the OS is not an option.

There is no package nvidia-driver-430 in debian.
And ubuntu packages are not compatible with debian.

Thanks! That cleared it up a bit.

I installed driver 390.116 now via aptitude install nvidia-driver and as opposed to previously (I’ve tried this driver before) I can see the devices with nvidia-smi.

Is there a way that I can install a more recent driver so I can use CUDA 10.x?

towo:OMPC-AV3> LANG=C apt policy nvidia-driver
  Installed: 418.56-1
  Candidate: 418.74-1
  Version table:
     430.14-0.siduction.1 1
          1 experimental/non-free amd64 Packages
     418.74-1 500
        500 unstable/non-free amd64 Packages
     418.56-2 500
        500 testing/non-free amd64 Packages
 *** 418.56-1 100
        100 /var/lib/dpkg/status
     390.116-1 500
        500 stable/non-free amd64 Packages

Now think about your choices.

I managed to install 418.56 with cuda10.1 on debian 9 stretch.

For others who encounter this thread later:

After adding

deb stretch-backports main contrib non-free

To /etc/apt/sources.list and running apt-get update & apt-get upgrade

I ran:

apt-get install -t stretch-backports nvidia-cuda-toolkit

I’ve tried all that and then some that in the past, but always had some issue with the driver not installing properly and not loading. Purging and installing driver 390 with aptitude instead of apt fixed some issue after I removed some conflicting packages as described here:

Edit: nope, that installed Cuda 9.1 instead of 10.1…

Your answer helped me put 2 and 2 together, I learned that there are ‘testing’ and experimental packages available for debian, cuda 10.0.130 is currently experimental and I got it installed.