Installing CUDA Debian Packages

Install the CUDA 11.4 Debian packages for Linux under the same folder.

sudo dpkg -i ./cuda-repo-ubuntu2004-11-4-local_11.4.17-470.129.06-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-11-4-local/cuda-1472B7CC-keyring.gpg /usr/share/keyrings/
sudo dpkg -i ./cuda-repo-cross-aarch64-ubuntu2004-11-4-local_11.4.17-1_all.deb
sudo cp /var/cuda-repo-cross-aarch64-ubuntu2004-11-4-local/cuda-DB1C1986-keyring.gpg /usr/share/keyrings/
sudo apt update
sudo apt -y install cuda-toolkit-11-4
sudo apt -y install cuda-cross-aarch64-11-4

In case of any issue with the installation, remove old packages and reinstall:

sudo rm /var/lib/apt/lists/_var_cuda*
sudo apt --fix-broken install -y
sudo apt autoremove -y
sudo apt remove --purge -y "cuda*"
sudo apt remove --purge -y "*cublas*"