CUDA won't install on Jetson Nano

I get the following error when installing CUDA on a Jetson Nano. I have checked the dependencies with uname - r and they should be there

$sudo apt-get -y install cuda
Reading package lists… Done Building dependency tree Reading state information… Done cuda is already the newest version (11.0.1-1). You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: cuda-drivers-450 : Depends: libnvidia-compute-450 (>= 450.36.06) but it is not going to be installed Depends: libnvidia-gl-450 (>= 450.36.06) but it is not going to be installed libnvidia-decode-450 : Depends: libnvidia-compute-450 (= 450.36.06-0ubuntu1) but it is not going to be installed libnvidia-ifr1-450 : Depends: libnvidia-gl-450 but it is not going to be installed nvidia-compute-utils-450 : Depends: libnvidia-compute-450 but it is not going to be installed nvidia-driver-450 : Depends: libnvidia-gl-450 (= 450.36.06-0ubuntu1) but it is not going to be installed Depends: libnvidia-compute-450 (= 450.36.06-0ubuntu1) but it is not going to be installed nvidia-utils-450 : Depends: libnvidia-compute-450 but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). sudo apt-get install linux-headers-

$(uname -r) [sudo] password for gregory: Reading package lists… Done Building dependency tree Reading state information… Done E: Unable to locate package linux-headers-4.9.140-tegra E: Couldn't find any package by glob 'linux-headers-4.9.140-tegra' E: Couldn't find any package by regex 'linux-headers-4.9.140-tegra' gregory@gregory-desktop:

~$ uname -r 4.9.140-tegra

I have also tried to use the SDKManager as below but get the same messages as below

I have tried to install SDK Manager as below but get the same messages after downloading SDK Manager.

gregory@gregory-desktop:~/Downloads$ sudo apt install ./sdkmanager_1.1.0-6343_amd64.deb
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
cuda-drivers-450 : Depends: libnvidia-compute-450 (>= 450.36.06) but it is not installed
Depends: libnvidia-gl-450 (>= 450.36.06) but it is not installed
libnvidia-decode-450 : Depends: libnvidia-compute-450 (= 450.36.06-0ubuntu1) but it is not installed
libnvidia-ifr1-450 : Depends: libnvidia-gl-450 but it is not installed
nvidia-compute-utils-450 : Depends: libnvidia-compute-450 but it is not installed
nvidia-driver-450 : Depends: libnvidia-gl-450 (= 450.36.06-0ubuntu1) but it is not installed
Depends: libnvidia-compute-450 (= 450.36.06-0ubuntu1) but it is not installed
nvidia-utils-450 : Depends: libnvidia-compute-450 but it is not installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

To start with, “amd64” is only for the desktop PC. SDK Manager runs only on the PC, but can be used to add software to a Nano over ssh (SDKM runs on the PC and talks to the fully booted Nano over ethernet with ssh).

This occurs sometimes and might be useful on either the Nano or the host PC:

You can run this on host and/or Jetson if you see this and it might fix a broken dependency:

sudo apt update
sudo apt --fix-broken install

If you are running a more recent L4T release on the Nano, then this will tell you about a release version:
dpkg -l | grep 'nvidia-l4t-core'

If you are running a more recent release, and that package is not installed, then you can:

sudo apt update
sudo apt-get install nvidia-l4t-core

…and then search for and/or install CUDA using “apt” just like any Ubuntu PC, e.g.:
apt search cuda