If you are going to read this post, thinking that you need to install CUDA Toolkit in Ubuntu by first downloading the deb or run package and then invoking the terminal adding the deb package in your system’s local repository and so on, then you are at the wrong place.
In this post, I’ll tell you how to install the CUDA Toolkit in Ubuntu by running just a single command. The following instructions assume that you already have the compatible NVIDIA CUDA hardware installed on your system and have installed the NVIDIA Drivers from the Proprietary GPU Drivers PPA.
To install the most stable and updated NVIDIA Graphics Drivers from the Proprietary GPU Drivers PPA, follow the instructions from this post, How to Install Latest Nvidia Drivers in Ubuntu
Now, after adding the repository and installing the NVIDIA Graphics drivers, just install two packages using the following command:
sudo apt-get install nvidia-modprobe nvidia-cuda-toolkit
This is it, just let the installation finish. After that, just run the following command to verify the installation and check the CUDA Toolkit Version.