Cannot install cuda (any version) - dependency/configuration errors

Hi,
I have a GeForce RTX 3080Ti and running Ubuntu 20.04. I was trying to run some code using pytorch (installed within pipenv compiled with cuda 11.7). My system cuda version was 10 and the code complained about the version mismatch. So, being in a hurry and really needing the code (depending specifically on that particular pytorch version apparently, idk) I decided to upgrade cuda to 11.7.

I followed the official installation guidelines, made sure I performed all steps required, but the installation simply didn’t work. I uninstalled (again following the official webpage) and reinstalled multiple times, even versions up to 12.1 (at this point I just want SOMETHING to work), and always got failure.
The last commands of the installation guides

sudo apt-get -y install cuda

always finish with:

Setting up nvidia-dkms-530 (530.30.02-0ubuntu1) ...
update-initramfs: deferring update (trigger activated)

A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau
from loading. This can be reverted by deleting the following file:
/etc/modprobe.d/nvidia-graphics-drivers.conf

A new initrd image has also been created. To revert, please regenerate your
initrd by running the following command after deleting the modprobe.d file:
`/usr/sbin/initramfs -u`

*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can   ***
*** be loaded.                                                            ***
*****************************************************************************

INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Removing old nvidia-530.30.02 DKMS files...

------------------------------
Deleting module version: 530.30.02
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-530.30.02 DKMS files...
Building for 5.15.0-113-generic
Building for architecture x86_64
Building initial module for 5.15.0-113-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-530.0.crash'
Error! Bad return status for module build on kernel: 5.15.0-113-generic (x86_64)
Consult /var/lib/dkms/nvidia/530.30.02/build/make.log for more information.
dpkg: error processing package nvidia-dkms-530 (--configure):
 installed nvidia-dkms-530 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of cuda-drivers-530:
 cuda-drivers-530 depends on nvidia-dkms-530 (>= 530.30.02); however:
  Package nvidia-dkms-530 is not configured yet.

dpkg: error processing package cuda-drivers-530 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-driver-530:
 nvidia-driver-530 depends on nvidia-dkms-530 (= 530.30.02-0ubuntu1); however:
  Package nvidia-dkms-530 is not configured yet.

dpkg: error processing package nvidia-driver-530 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-drivers:
 cuda-drivers depends on cuda-drivers-530 (= 530.30.02-1); however:
  Package cuda-drivers-530 is not configured yet.

dpkg: error processing package cuda-drivers (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-runtime-12-1:
 cuda-runtime-12-1 depends on cuda-drivers (>No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                                       No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                                                                                                                                                 No apport report written because MaxReports is reached already
                                                No apport report written because MaxReports is reached already
                                                                                                              No apport report written because MaxReports is reached already
                                                                                                                                                                            No apport report written because MaxReports is reached already
                                                                                                                                                                                                                                          No apport report written because MaxReports is reached already
                         = 530.30.02); however:
  Package cuda-drivers is not configured yet.

dpkg: error processing package cuda-runtime-12-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-12-1:
 cuda-12-1 depends on cuda-runtime-12-1 (>= 12.1.0); however:
  Package cuda-runtime-12-1 is not configured yet.

dpkg: error processing package cuda-12-1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda:
 cuda depends on cuda-12-1 (>= 12.1.0); however:
  Package cuda-12-1 is not configured yet.

dpkg: error processing package cuda (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-demo-suite-12-1:
 cuda-demo-suite-12-1 depends on cuda-runtime-12-1; however:
  Package cuda-runtime-12-1 is not configured yet.

dpkg: error processing package cuda-demo-suite-12-1 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-113-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p2
I: (UUID=f16b7f16-028f-43d8-8edb-423ef33ec722)
I: Set the RESUME variable to override this.
Errors were encountered while processing:
 nvidia-dkms-530
 cuda-drivers-530
 nvidia-driver-530
 cuda-drivers
 cuda-runtime-12-1
 cuda-12-1
 cuda
 cuda-demo-suite-12-1
E: Sub-process /usr/bin/dpkg returned an error code (1)

And this is the same whether I try to “install cuda” or specify the version and eg. “install cuda-12-1”.

If I try just installing the driver first (“dkms status” returns “nvidia, 530.30.02: added” ) I get same errors, and the same with apt --fix-broken install and sudo dpkg --configure -a.

I am at a complete loss of what to do; I’ve tried at least a dozen different solutions for similar issues across the internet and nothing works. I really desperately need my gpu to work with python, so I just need A version of CUDA up and running; I’ll take anything <=12.1 at this point (I’ll figure out what to do with the old inherited pytorch code with the specific dependencies later).

Please help