Skip to content

Instantly share code, notes, and snippets.

@helena-intel
Last active June 19, 2025 11:47
Show Gist options
  • Save helena-intel/2afc89e8b9eb08105d080a8cdc6127ac to your computer and use it in GitHub Desktop.
Save helena-intel/2afc89e8b9eb08105d080a8cdc6127ac to your computer and use it in GitHub Desktop.
Install CUDA 12.4 on Ubuntu 24.04

CUDA 12.4 install on ubuntu 24.04

Source: https://askubuntu.com/questions/1491254/installing-cuda-on-ubuntu-23-10-libt5info-not-installable

CUDA 12.4 is not available for Ubuntu 24.04. If you try to install the .deb for 22.04 you may get an error like

The following packages have unmet dependencies:
 nsight-systems-2023.4.4 : Depends: libtinfo5 but it is not installable

To fix this:

sudo nano /etc/apt/sources.list.d/ubuntu.sources

Add:

Types: deb
URIs: http://old-releases.ubuntu.com/ubuntu/
Suites: lunar
Components: universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

After this, you can install CUDA following the instructions for 22.04:

curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
curl -O https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-4-local_12.4.0-550.54.14-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-4-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-4

If you already downloaded/copied the files, don't forget the apt update part before trying apt install again.

Some tools expect CUDA_HOME. Set it as follows:

export CUDA_HOME=/usr/local/cuda-12.4/

If you need nvcc or other tools:

sudo apt install nvidia-cuda-toolkit

Proxy/slow network

If you happen to be on a system with a slow network connection behind a proxy, add these files in /etc/apt/apt.conf.d:

99proxy:

Acquire::http::Proxy "http://proxy.example.com:912";
Acquire::https::Proxy "http://proxy.example.com:912";

99timeout:

Acquire::http::Timeout "120";
Acquire::ftp::Timeout "120";
Acquire::Retries "5";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment