How To Install nvidia-cuda-dev on Ubuntu 20.04

In this tutorial we learn how to install nvidia-cuda-dev on Ubuntu 20.04. nvidia-cuda-dev is NVIDIA CUDA development files

Introduction

In this tutorial we learn how to install nvidia-cuda-dev on Ubuntu 20.04.

What is nvidia-cuda-dev

nvidia-cuda-dev is:

The Compute Unified Device Architecture (CUDA) enables NVIDIA graphics processing units (GPUs) to be used for massively parallel general purpose computation.

This package contains the development files: headers and libraries.

There are three methods to install nvidia-cuda-dev on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install nvidia-cuda-dev Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install nvidia-cuda-dev using apt-get by running the following command:

sudo apt-get -y install nvidia-cuda-dev

Install nvidia-cuda-dev Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install nvidia-cuda-dev using apt by running the following command:

sudo apt -y install nvidia-cuda-dev

Install nvidia-cuda-dev Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install nvidia-cuda-dev using aptitude by running the following command:

sudo aptitude -y install nvidia-cuda-dev

How To Uninstall nvidia-cuda-dev on Ubuntu 20.04

To uninstall only the nvidia-cuda-dev package we can use the following command:

sudo apt-get remove nvidia-cuda-dev

Uninstall nvidia-cuda-dev And Its Dependencies

To uninstall nvidia-cuda-dev and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove nvidia-cuda-dev

Remove nvidia-cuda-dev Configurations and Data

To remove nvidia-cuda-dev configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge nvidia-cuda-dev

Remove nvidia-cuda-dev configuration, data, and all of its dependencies

We can use the following command to remove nvidia-cuda-dev configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge nvidia-cuda-dev

References

Summary

In this tutorial we learn how to install nvidia-cuda-dev package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.