-1

After following all the instructions in CUDA Toolkit 11.7 Downloads, the last instruction

sudo apt-get -y install cuda

doesn't work for me.

Terminal shows this message:

dmitriy@dmitriy:~/git/drake$ sudo apt-get -y install cuda
Reading package lists... Done
Building dependency tree       
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: cuda : Depends: cuda-11-7 (>= 11.7.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

PS: I have an NVIDIA Geforce 920MX card in my computer.

I try this: How do I resolve unmet dependencies after adding a PPA? (14 answers)

And I got this after this command sudo apt-get -u dist-upgrade, but I have the same error:

dmitriy@dmitriy:/var$ sudo apt-get -u dist-upgrade
Reading package lists... Done
                   ...
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-41-generic
Found initrd image: /boot/initrd.img-5.15.0-41-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found linux image: /boot/vmlinuz-5.13.0-51-generic
Found initrd image: /boot/initrd.img-5.13.0-51-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 10 on /dev/sda1
done

output of sudo apt update:

dmitriy@dmitriy:/var$ sudo apt update
Get:1 file:/var/cuda-repo-ubuntu2004-11-7-local  InRelease [1575 B]
Get:1 file:/var/cuda-repo-ubuntu2004-11-7-local  InRelease [1575 B]
Hit:2 http://ru.archive.ubuntu.com/ubuntu focal InRelease
Hit:3 http://ru.archive.ubuntu.com/ubuntu focal-updates InRelease    
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease        
Get:5 http://ru.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:6 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease 
Hit:7 http://archive.ubuntu.com/ubuntu focal InRelease               
Hit:8 http://security.ubuntu.com/ubuntu focal-security InRelease     
Get:9 http://packages.microsoft.com/repos/code stable InRelease [10.4 kB]
Hit:10 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal InRelease
Get:11 https://repo.protonvpn.com/debian stable InRelease [2519 B]   
Hit:12 https://download.docker.com/linux/ubuntu focal InRelease      
Hit:13 http://ppa.launchpad.net/mkusb/ppa/ubuntu focal InRelease     
Hit:14 https://deb.nodesource.com/node_18.x focal InRelease          
Fetched 121 kB in 2s (72.7 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

and output of sudo apt upgrade:

dmitriy@dmitriy:/var$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  linux-headers-5.13.0-51-generic linux-hwe-5.13-headers-5.13.0-51
  linux-image-5.13.0-51-generic linux-modules-5.13.0-51-generic
  linux-modules-extra-5.13.0-51-generic
  linux-modules-nvidia-470-5.13.0-51-generic
  linux-objects-nvidia-470-5.13.0-51-generic
  linux-signatures-nvidia-5.13.0-51-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

This didn't help:

Unable to correct problems, you have held broken packages (15 answers) Any solution please?

Any suggestion please?

  • 1
    "you have held broken packages" - your package management needs to be in good shape before you attempt to add anything new. Please edit your question with the output of sudo apt update and sudo apt upgrade. Generally, you should run these commands and they should come back clean before you do other actions in apt. Also, don't use the -y flag unless you don't want to be alerted to potential problems. – Nmath Jul 13 '22 at 23:08
  • 1
    Telling us which remote procedure (RP) you "followed" doesn't help us help you for N reasons: 1) It's remote. Will the link exist tomorrow? 2) Reading the RP doesn't tell us how accurately you "followed" it. Did you suffer typos or missed lines? We have. 3) Reading the RP omits the error messages you got on your system. These error messages (and the commands that caused them) are key elements in any diagnosis. – waltinator Jul 13 '22 at 23:17
  • @waltinator I followed RP accurately. Do you want that I past every step here? – Dmitriy Ogureckiy Jul 13 '22 at 23:29
  • I find it far easier to use the ...run file to install, override every system location with your locations, reject nvidia driver offer, than to untangle the depends nvidia put on their stuff. The Ubuntu standard repos should work, but I've never used them as they never offered me the version I wanted. The ...run file is big, so it takes awhile to read and throw up a screen (minute(s?)). See https://askubuntu.com/questions/1077061/how-do-i-install-nvidia-and-cuda-drivers-into-ubuntu/1077063#1077063 https://askubuntu.com/questions/1219761/cuda-10-2-different-installation-paths/1244010#1244010 – ubfan1 Jul 13 '22 at 23:53
  • 1
    What's going on with your sources? You have a lot of non-canonical (big C and lowercase c) sources. Adding outdated, mismatched, or conflicting sources can be a cause of package version conflicts. What are the two sources that start with file:/var/cuda-repo-? And why do you have a PPA for graphics-drivers? Aside, and possibly related, you have the deadsnakes PPA which suggests you've changed the python interpreter on your system. That would be a big mistake since so much of the system requires that you do not change the python interpreter. Please advise on all of these added repos/sources – Nmath Jul 14 '22 at 19:15

2 Answers2

0

Installing Aptitude is not a direct answer, but between apt, apt-get and synaptic, fixing dependency hell is quite difficult; aptitude is actually more user-friendly at it.

-1

aptitude

Install aptitude

sudo apt-get install aptitude

Install main package

sudo aptitude install cuda

  • No need to install aptitude in order to install any package in the repositories; and choosing the official repository version from the start would have saved you a lot of trouble; and Ubuntu "prefers" apt instead of apt-get since a long time ago (nothing wrong with using one or the other though but aptitude is absolutely unnecessary and redundant). All you had to do was sudo apt install cuda. Very poor answer. – ChanganAuto Jul 14 '22 at 11:25