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

Hi,
New GPU server Dell Poweredge R740xd with Ubunut 18.04 and NVIDIA Tesla V100 32G Passive GPU.

I am very new at CUDA install so please forgive my lack of knowledge and thank you in advance for any support and help you can provide.

I tried to install CUDA following instructions at

I downlaoded the CUDA toolkit 10.0 from

I choose:
Linux
x86_64
Ubuntu 18.04
Network

I then ran
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update

The problem appears wthen i ran
sudo apt-get install cuda
I got the following error:

sudo apt-get 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-10-0 (>= 10.0.130) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

what am i doing wrong?
How can I fix the problem ?

Thank you for your help.

Eric

4 Likes

hello:
do you solve this porblem ?

1 Like

Hello, anyone solve this problem yet? Same problem here

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!

36 Likes

Same problem as I installed the nvidia-415 for my rtx 2070.
You should take a look at this.
https://askubuntu.com/questions/598607/package-dependency-problem-while-installing-cuda-on-ubuntu-14-04
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.

7 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

55 Likes

Than you everyone for all your help. I followed the instructions on that website How to install CUDA 9.2 on Ubuntu 18.04
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.

1 Like

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

4 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.

9 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 [url]http://www.nvidia.com/getcuda[/url], 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
4 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.