CUDA install unmet dependencies: cuda : Depends: cuda-10-0 (>= 10.0.130) but it is not going to be installed

Guys seriously, will someone reply here?! This method is written on your official page and yet doesn’t work. How sad is that it’s a huge pain to install simple drivers because NVIDIA coders haven’t done their work well!

28 Likes

Same problem as I installed the nvidia-415 for my rtx 2070.
You should take a look at this.


I resolved it by using the tool mentioned in one of those answers: aptitude
While it did not fix it directly, it pointed out that I got the wrong version of libgl1-mesa-glx.
I looked for the specified version and installed it.
After that, I can run sudo apt-get install cuda
and it did removed my nvidia-415 and installed the nvidia-410.

4 Likes

Came across this a while back and wanted to provide the correct instructions to resolve as there is no need to use aptitude here.
For clean install you must purge all previous cuda, nvidia packages etc.

As root execute following:

apt clean; apt update; apt purge cuda; apt purge nvidia-*; apt autoremove; apt install cuda

39 Likes

Than you everyone for all your help. I followed the instructions on that website https://www.pugetsystems.com/labs/hpc/How-to-install-CUDA-9-2-on-Ubuntu-18-04-1184/#step-1-get-ubuntu-1804-installed
I had to tweet few things but at the end i “think” it worked. The only i had to be careful with is the Nvidia driver version for CUDA 10. I had 395.* I thought that the Driver will be updated automatically.
I removed the nvidia-395 and installed nvidia-415.

sudo apt-get remove nvidia-cuda-* # remove old nvidia-cuda packages

3 Likes

It may mean that one of the packages in the dependency chain cannot be installed.

One of the dependent packages is freeglut3-dev

This is from the ubuntu universe repo.

If you have not added this repo, it will not be installable, and you will get this message about “cuda : Depends: cuda-10-0 (>= 10.0.130) but it is not going to be installed”

To solve this particular example (freeglut3-dev), add the ubuntu universe repository (google that), and install freeglut3-dev:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install freeglut3 freeglut3-dev libxi-dev libxmu-dev

To debug the issue more generally (if it is not due to freeglut3-dev), you have to chase the dependency chain. Each time it says a package is not going to be installed, add that package to your install line, eg.

sudo apt-get install cuda-10-0 cuda-toolkit-10-0

and keep this process up until you get to a package that can’t be installed.

8 Likes

Sometimes, it may caused by wrong dependency packages installed before. You can just install package it said in terminal one by one and finally you will find which dependency package is the wrong guy.

@Robert_Croverlla,
Thanks a lot as always.
I tried fresh installing cuda10.0 with nvidia-410 and met the same problem. (dependency)
so I followed your advice, and incrementally added required packages required for cuda-10.0, until the “sudo apt-get install cuda-10.0 …” command worked.
But I have an error at the end while rebuilding the kernel, and the message says I should look into /var/lib/dkms/nvidia-410/410.78/build/make.log . The make.log file ends with below error messages.
CC [M] /var/lib/dkms/nvidia-410/410.78/build/nvidia/nv-kthread-q-selftest.o
CC [M] /var/lib/dkms/nvidia-410/410.78/build/nvidia/nv-memdbg.o
CC [M] /var/lib/dkms/nvidia-410/410.78/build/nvidia/nv-ibmnpu.o
CC [M] /var/lib/dkms/nvidia-410/410.78/build/nvidia/nv-report-err.o
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:21:0,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c: In function ‘os_lock_user_pages’:
/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:120:48: warning: passing argument 6 of ‘get_user_pages’ makes pointer from integer without a cast
page_count, write, force, user_pages, NULL);
^
/var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-mm.h:44:70: note: in definition of macro ‘NV_GET_USER_PAGES’
get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
^
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-pgprot.h:17:0,
from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:20,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
include/linux/mm.h:1243:6: note: expected ‘struct page **’ but argument is of type ‘NvBool’
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
^
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:21:0,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:120:55: warning: passing argument 7 of ‘get_user_pages’ from incompatible pointer type
page_count, write, force, user_pages, NULL);
^
/var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-mm.h:44:77: note: in definition of macro ‘NV_GET_USER_PAGES’
get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
^
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-pgprot.h:17:0,
from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:20,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
include/linux/mm.h:1243:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
^
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:21:0,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
/var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-mm.h:44:9: error: too many arguments to function ‘get_user_pages’
get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
^
/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:119:11: note: in expansion of macro ‘NV_GET_USER_PAGES’
ret = NV_GET_USER_PAGES((unsigned long)address,
^
In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-pgprot.h:17:0,
from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:20,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
include/linux/mm.h:1243:6: note: declared here
long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
^
scripts/Makefile.build:285: recipe for target ‘/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.o’ failed
make[2]: *** [/var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.o] Error 1
make[2]: *** Waiting for unfinished jobs…
Makefile:1454: recipe for target ‘module/var/lib/dkms/nvidia-410/410.78/build’ failed
make[1]: *** [module/var/lib/dkms/nvidia-410/410.78/build] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-4.4.0-164-generic’
Makefile:79: recipe for target ‘modules’ failed
make: *** [modules] Error 2

From below message above,
"In file included from /var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-linux.h:21:0,
from /var/lib/dkms/nvidia-410/410.78/build/nvidia/os-mlock.c:15:
/var/lib/dkms/nvidia-410/410.78/build/common/inc/nv-mm.h:44:9: error: too many arguments to function ‘get_user_pages’
get_user_pages(current, current->mm, start, nr_pages, write, force, pages, vmas)
", there seems to be version mismatch problem. should I install higher nvidia version? or lower version?

You appear to either have a mixed/corrupted install, or else trying to install the 410.78 driver on a very new OS kernel version.

  1. Choose the CUDA version you would like to install.
  2. Go to http://www.nvidia.com/getcuda, and if needed click on the Legacy Releases page
  3. Start by downloading the CUDA linux install guide for that CUDA version, and read it.
  4. Choose a linux OS that is listed as supported in that document.
  5. Make a fresh new install of that OS.
  6. Choose an install method, either runfile install or package manager install. Read the linux install guide to familiarize yourself with the difference.
  7. Download the appropriate installer, and follow the install instructions carefully.

At this point I wouldn’t recommend allowing any kernel updates of any kind. If you choose to do so anyway, then you’ll need to familiarize yourself with how to use DKMS to ride through such an event. I won’t be able to provide detailed DKMS usage instructions here.

Hi, guys. If you still meet this issue. Try at first

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install freeglut3-dev

Then follow the instructions in https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal if you are using Ubuntu 16.04 (otherwise, following the instructions according to your case). For the installation step, instead of simply installing cuda, do

sudo apt-get -y install cuda cuda-10-1 cuda-toolkit-10-1 cuda-samples-10-1 cuda-documentation-10-1

Good luck.

3 Likes

One of the solutions is suggested in the error message itself.

E: Unable to correct problems, you have held broken packages.

In my case the way to remove held packages was to simply run

sudo apt-get update
sudo apt-get autoremove

and then again

sudo apt-get install cuda
3 Likes

I have gone through a lot of posts on this topic and tried a lot of different solutions but I still get the same problem :
The following packages have unmet dependencies:
cuda : Depends: cuda-10-0 (>= 10.0.130) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I had cuda10.1 installed prior and working. One day sudo apt-get autoremove showed me few cuda files which it listed as not being used and prompted me to remove them. Doing so resulted in nvcc showing cuda not installed.

I have a deb package “cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64” which whenever I try to install gives the error:
cuda : Depends: cuda-10-0 (>= 10.0.130) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I have already tried to purge nvidia and cuda and also purged all the packages listed by :
dpkg -l | grep -i cuda and dpkg -l | grep -i nvidia.

Even after doing so I get the same cuda-10-0 (>= 10.0.130) error.

I feel the problem might be a file named “cuda-10-0-local-10.0.130-410.48.list.save” in my “etc/apt/sources.list.d” folder but I am not sure.I have attached the screenshot.

Can someone please guide on how to reinstall cuda ? I have already faced this issue once before and had to reinstall UBUNTU, which I am afraid is not an option anymore.

P.S. Ignore the anaconda cuda files in the screenshot

2 Likes

I got the same problem. I finally managed to solve the problem by installing the graphic driver from ppa:graphics-drivers/ppa
You can see details in https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux

Previously I installed the driver from .run file and also from software & updates\ additional drivers but non completely worked for me.

2 Likes

Thank you for not only posting an answer but also the process for solving it. 100 internet points to you, sir.

This worked for me thanks

Wow that’s work for me! Finally installed cuda, thanks a lot!

Oh doesn’t work anymore… the driver was died when I power off my computer.

I Installs cuda 10.1 deb and then install 10.0 deb. It’s work.

This is fine for Nvidia but does not address the CUDA installation issues.

Does anyone know how to solve this problem? i tried all solutions to fix this but it does not work. Before i worked with cuda 10.1 were fine, once i upgrade to cuda 11 this problems come.

i followed this step to install https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804&target_type=deblocal

Blockquotesudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
You might want to run ‘apt --fix-broken install’ to correct these.
The following packages have unmet dependencies:
cuda-command-line-tools-11-0 : Depends: cuda-cupti-dev-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-nvprof-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-nvtx-11-0 (>= 11.0.167) but it is not installed
cuda-compiler-11-0 : Depends: cuda-nvcc-11-0 (>= 11.0.194) but it is not installed
cuda-drivers-450 : Depends: nvidia-450 (>= 450.51.06) but it is not installed
cuda-libraries-11-0 : Depends: cuda-cudart-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-nvrtc-11-0 (>= 11.0.194) but it is not installed
Depends: libcublas-11-0 (>= 11.1.0.229) but it is not installed
Depends: libcufft-11-0 (>= 10.2.0.218) but 10.1.3.191-1 is installed
Depends: libcurand-11-0 (>= 10.2.1.218) but 10.2.0.191-1 is installed
Depends: libcusolver-11-0 (>= 10.5.0.218) but 10.4.0.191-1 is installed
Depends: libcusparse-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnpp-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnvjpeg-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
cuda-libraries-dev-11-0 : Depends: cuda-cudart-dev-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-driver-dev-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-nvrtc-dev-11-0 (>= 11.0.194) but it is not installed
Depends: libcublas-dev-11-0 (>= 11.1.0.229) but it is not installed
Depends: libcufft-dev-11-0 (>= 10.2.0.218) but 10.1.3.191-1 is installed
Depends: libcurand-dev-11-0 (>= 10.2.1.218) but 10.2.0.191-1 is installed
Depends: libcusolver-dev-11-0 (>= 10.5.0.218) but 10.4.0.191-1 is installed
Depends: libcusparse-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnpp-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnvjpeg-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
cuda-samples-11-0 : Depends: cuda-nvrtc-dev-11-0 but it is not installed
Depends: cuda-nvcc-11-0 but it is not installed
Depends: libcublas-dev-11-0 but it is not installed
Depends: cuda-cudart-dev-11-0 but it is not installed
Depends: cuda-driver-dev-11-0 but it is not installed
cuda-toolkit-11-0 : Depends: cuda-nvml-dev-11-0 (>= 11.0.167) but it is not installed
cuda-visual-tools-11-0 : Depends: cuda-cudart-dev-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-driver-dev-11-0 (>= 11.0.194) but it is not installed
Depends: cuda-nvml-dev-11-0 (>= 11.0.167) but it is not installed
Depends: cuda-nvrtc-dev-11-0 (>= 11.0.194) but it is not installed
Depends: libcublas-dev-11-0 (>= 11.1.0.229) but it is not installed
Depends: libcufft-dev-11-0 (>= 10.2.0.218) but 10.1.3.191-1 is installed
Depends: libcurand-dev-11-0 (>= 10.2.1.218) but 10.2.0.191-1 is installed
Depends: libcusolver-dev-11-0 (>= 10.5.0.218) but 10.4.0.191-1 is installed
Depends: libcusparse-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnpp-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
Depends: libnvjpeg-dev-11-0 (>= 11.1.0.218) but 11.0.0.191-1 is installed
nvidia-450-dev : Depends: nvidia-450 (>= 450.51.06) but it is not installed
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

Blockquote