Unable to find nvcc in the command line

I ran the attached bash script; however, I don’t see nvcc in the command line.

What is missing in the bash script?

What am I doing wrong?

#!/bin/bash

# Create the Download directory if it does not exist and navigate into it
mkdir -p Download
cd Download

# List of file URLs
files=(
    "cuda_11.0.2_450.51.05_linux.run"
    "7fa2af80.pub"
    "libnccl2_2.8.3-1+cuda11.0_amd64.deb"
    "libnccl-dev_2.8.3-1+cuda11.0_amd64.deb"
    "nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb"
    "cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb"
    "nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.deb"
)

# Download files
for file in "${files[@]}"; do
    if [ ! -f "$file" ]; then
        wget "http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/$file"
        if [ $? -ne 0 ]; then
            echo "Failed to download $file"
            exit 1
        fi
    fi
done

# Download and move cuda pin
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600

# Download and install local CUDA repository DEB
wget https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda-repo-ubuntu2004-11-0-local_11.0.3-450.51.06-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-0-local_11.0.3-450.51.06-1_amd64.deb

# Add the apt-key
sudo apt-key add /var/cuda-repo-ubuntu2004-11-0-local/7fa2af80.pub

# Update system and install CUDA
sudo apt-get update
sudo apt-get -y install cuda

# Install downloaded packages
sudo dpkg -i libnccl2_2.8.3-1+cuda11.0_amd64.deb
sudo dpkg -i libnccl-dev_2.8.3-1+cuda11.0_amd64.deb
sudo dpkg -i nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb
sudo dpkg -i cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb
sudo dpkg -i nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.deb

# Fix any potential broken dependencies
sudo apt-get install -f

# Find CUDA version and set CUDA_HOME to correct path
CUDA_VERSION=$(ls /usr/local | grep cuda- | sed 's/cuda-//')
export CUDA_HOME=/usr/local/cuda-$CUDA_VERSION

# Add CUDA_HOME to .bashrc if it doesn't already exist
if ! grep -q "export CUDA_HOME=${CUDA_HOME}" ~/.bashrc ; then
    echo "Adding CUDA_HOME to ~/.bashrc"
    echo "export CUDA_HOME=${CUDA_HOME}" >> ~/.bashrc
else
    echo "CUDA_HOME already exists in ~/.bashrc. Skipping..."
fi

# Go back to the parent directory
cd ..
... ... ... ... ... ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
cuda is already the newest version (11.4.3-1).
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
(Reading database ... 260654 files and directories currently installed.)
Preparing to unpack libnccl2_2.8.3-1+cuda11.0_amd64.deb ...
Unpacking libnccl2 (2.8.3-1+cuda11.0) over (2.8.3-1+cuda11.0) ...
Setting up libnccl2 (2.8.3-1+cuda11.0) ...
Processing triggers for libc-bin (2.31-0ubuntu9.12) ...
(Reading database ... 260654 files and directories currently installed.)
Preparing to unpack libnccl-dev_2.8.3-1+cuda11.0_amd64.deb ...
Unpacking libnccl-dev (2.8.3-1+cuda11.0) over (2.8.3-1+cuda11.0) ...
Setting up libnccl-dev (2.8.3-1+cuda11.0) ...
(Reading database ... 260654 files and directories currently installed.)
Preparing to unpack nvidia-machine-learning-repo-ubuntu2004_1.0.0-1_amd64.deb ...
Unpacking nvidia-machine-learning-repo-ubuntu2004 (1.0.0-1) over (1.0.0-1) ...
Setting up nvidia-machine-learning-repo-ubuntu2004 (1.0.0-1) ...
dpkg-deb: error: 'cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb' is not a Debian format archive
dpkg: error processing archive cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb (--install):
 dpkg-deb --control subprocess returned error exit status 2
Errors were encountered while processing:
 cudnn-local-repo-ubuntu2004-8.9.6.50_1.0-1_amd64.deb
(Reading database ... 260654 files and directories currently installed.)
Preparing to unpack nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8_1.0-1_amd64.deb ...
Unpacking nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8 (1.0-1) over (1.0-1) ...
Setting up nv-tensorrt-local-repo-ubuntu2004-8.6.1-cuda-11.8 (1.0-1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.
CUDA_HOME already exists in ~/.bashrc. Skipping...

my_user_name@192:~$ nvcc

Command 'nvcc' not found, but can be installed with:

sudo apt install nvidia-cuda-toolkit

my_user_name@192:~$

after installing CUDA it is necessary to follow the mandatory post-setup instructions in the CUDA linux install guide. Particularly set up the PATH variable.