14

Today I've installed from scratch Ubuntu 23.10 on my computer. After having installed all the software I need, I tried to install CUDA from the NVIDIA website, following their instructions: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local

There's written that the latest version supported is 22.04 anyway I tried..., the problem happens with the last command sudo apt-get -y install cuda-toolkit-12-3 because the terminal gives me an error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nsight-systems-2023.3.3 : Depends: libtinfo5 but it is not installable
E: Unable to correct problems, you have held broken packages.

I tried to manually install such library but I get E: Package 'libtinfo5' has no installation candidate

Is there any way to install cuda on this system ?

2 Answers 2

26

For Ubuntu 23.10:

The libtinfo5 package isn't available in Ubuntu 23.10's default repositories yet. We can install it by adding the universe repo for Ubuntu 23.04 (Lunar Lobster).

Open a terminal window and run:

sudo nano /etc/apt/sources.list

Add this line (adds the Ubuntu 23.04 aka "Lunar Lobster" universe repository to apt):

deb http://archive.ubuntu.com/ubuntu/ lunar universe

Save and exit, then run:

sudo apt update

...and now the install command for CUDA should work, automatically downloading and installing libtinfo5 while installing CUDA.

For Ubuntu 24.04 or newer:

  1. Open the new file for storing the sources list

    sudo nano /etc/apt/sources.list.d/ubuntu.sources
    
  2. Paste in the following at the end of the file:

    Types: deb
    URIs: http://archive.ubuntu.com/ubuntu/
    Suites: lunar
    Components: universe
    Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
    
  3. Save the file and run sudo apt update - now the install command for CUDA should work.

4
  • For future folks, this helps me with Ubuntu 24.04 too. Thanks!
    – mgNobody
    Commented May 18 at 3:00
  • 1
    Quick question: when opening the sources.list file as you mentioned above, on Ubuntu 24.04, I am seeing the following line on top of the file. Does that mean we should edit that file in future releases instead of what you mentioned above? # Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources Keep in mind that your file still works as I tested it in 24.04 (as mentioned in my last comment). Just wondering if you should edit your response for newer version of Ubuntus.
    – mgNobody
    Commented May 18 at 3:03
  • @mgNobody I'm not on Ubuntu 24.04 yet but yes, it sounds like future versions of Ubuntu will keep the APT sources list in /etc/apt/sources.list.d/ubuntu.sources. Thank you!
    – jspinella
    Commented May 20 at 18:18
  • 1
    @mgNobody I am now running Ubuntu 24.04 and I was able to confirm the steps for adding the repo using the new sources file format. Answer has been updated.
    – jspinella
    Commented Jun 6 at 0:29
5

I was able to install manually the package needed from the Ubuntu 23.04 (lunar) repo: https://packages.ubuntu.com/lunar/libtinfo5. Then, running sudo apt install cuda resulted in no errors and CUDA was correctly installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .