Packages have unmet dependencies

I’ve tried installing numerous times cuda on my jetson nano and I keep getting this error below:

djarami@djarami-desktop:~ sudo apt-get -y install cuda [sudo] password for djarami: Reading package lists... Done Building dependency tree Reading state information... Done cuda is already the newest version (11.3.0-1). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: cuda-drivers-465 : Depends: libnvidia-compute-465 (>= 465.19.01) but it is not going to be installed Depends: libnvidia-gl-465 (>= 465.19.01) but it is not going to be installed libnvidia-decode-465 : Depends: libnvidia-compute-465 (= 465.19.01-0ubuntu1) but it is not going to be installed libnvidia-ifr1-465 : Depends: libnvidia-gl-465 but it is not going to be installed nvidia-compute-utils-465 : Depends: libnvidia-compute-465 but it is not going to be installed nvidia-driver-465 : Depends: libnvidia-gl-465 (= 465.19.01-0ubuntu1) but it is not going to be installed Depends: libnvidia-compute-465 (= 465.19.01-0ubuntu1) but it is not going to be installed nvidia-utils-465 : Depends: libnvidia-compute-465 but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). djarami@djarami-desktop:~

1 Like

Maybe try the Jetson forum: Jetson & Embedded Systems - NVIDIA Developer Forums

Hi @djarami ,

I had the same issue, specifically with libnvidia-gl-465, when trying to install CUDA 11.3 on Jetson Xavier AGX. I was unable to get the complete install, and using apt to remove the partial CUDA installation was ineffective.

To remove the partial CUDA installation, I used dpkg. Here’s a list of commands that I used. You can see that the list is rather redundant. If you use similar steps to remove CUDA, you’ll likely find that some of the lines will fail due to dependencies. Once the dependent software packages are removed, you’ll eventually have the entire installation removed.

$ sudo dpkg --remove --force-remove-reinstreq cuda
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers-465
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers
$ sudo dpkg --remove --force-remove-reinstreq cuda-runtime-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-runtime-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-decode-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-encode-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-decode-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-ifr1-465
$ sudo dpkg --remove --force-remove-reinstreq nvidia-driver-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-ifr1-465 
$ sudo dpkg --remove --force-remove-reinstreq nvidia-compute-utils-465
$ sudo dpkg --remove --force-remove-reinstreq nvidia-driver-465
$ sudo dpkg --remove --force-remove-reinstreq nvidia-utils-465
$ sudo dpkg --remove --force-remove-reinstreq cuda 
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers-465
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers
$ sudo dpkg --remove --force-remove-reinstreq cuda-runtime-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-runtime-11-3
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers
$ sudo dpkg --remove --force-remove-reinstreq cuda-drivers-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-ifr1-465
$ sudo dpkg --remove --force-remove-reinstreq nvidia-driver-465
$ sudo dpkg --remove --force-remove-reinstreq libnvidia-ifr1-465

After all the packages are removed, you can clean it up with the following command.

$ sudo apt --purge autoremove

Hopefully NVIDIA will address this issue. In the meantime, I’m going back to CUDA 10.2 that was packaged with JetPack 4.5.1. If I run into any trouble, or make any interesting discoveries, I’ll follow up.

Good luck!