18

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 ?

noisefloor
  • 1,803
Dresult
  • 333

5 Answers5

36

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://old-releases.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://old-releases.ubuntu.com/ubuntu/
Suites: lunar
Components: universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  1. Save the file and run sudo apt update - now the install command for CUDA should work.
jspinella
  • 476
  • For future folks, this helps me with Ubuntu 24.04 too. Thanks! – mgNobody May 18 '24 at 03: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 May 18 '24 at 03: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 May 20 '24 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 Jun 06 '24 at 00:29
  • 1
    For Ubuntu 24.04 this should become http://old-releases.ubuntu.com/ubuntu/, as suggested by Jack Daus. – Manu J4 Jan 12 '25 at 21:58
  • Edited. Thank you! – jspinella Jan 17 '25 at 23:44
  • work on WSL windows 11. Thanks – Pamungkas Jayuda Mar 16 '25 at 05:37
6

The lunar suite is no longer available at the URI http://archive.ubuntu.com/ubuntu/. It is now at http://old-releases.ubuntu.com/ubuntu/. So for Ubuntu 24.04 or newer, the added source entry becomes,

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

(I would have made a comment or suggested an edit, but looks like I am unable to.)

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.

Dresult
  • 333
0

I just yoinked it from this site with these commands:

wget http://launchpadlibrarian.net/371711898/libtinfo5_6.1-1ubuntu1.18.04_amd64.deb
sudo dpkg -i libtinfo5_6.1-1ubuntu1.18.04_amd64.deb

then try the cuda installer again

Rosski
  • 1
0

libtinfo5 for Ubuntu 20.04LTS can be found from https://packages.ubuntu.com/.

Download libtinfo5_6.3-*.deb from https://packages.ubuntu.com/jammy/libtinfo5 and intall it via sudo dpkg -i libtinfo5_6.3-*.deb.

J. Choi
  • 101