6

I was working with CUDA5.5, however I wanted to install CUDA6.5 using the main repository given by nvidia.

sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb 
sudo apt-get update

But when I try to install cuda I get 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-6-5 (= 6.5-14) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I would appreciate any help.

ssierral
  • 163
  • 1
  • 1
  • 6

4 Answers4

7

Same error message with me, but none of the above answers helped in my case (Ubuntu 14.10). Therefore, first dissect the error message. It says:

The following packages have unmet dependencies:
cuda : Depends: cuda-6-5 (= 6.5-14) but it is not going to be installed.

So cuda has a dependency cuda-6-5, which can not be installed. Why? Let's check: sudo apt-get install cuda-6-5 produced a similar message to the original one for me saying something like:

The following packages have unmet dependencies:
cuda-6-5 : Depends: libcudart6.0 (=....) but it is not going to be installed.

So libcudart6.0 is the problem. Let's check why: sudo apt-get install libcudart6.0 results in:

The following packages have unmet dependencies:
libcudart6.0 : Depends: nvidia-340 (=....) but it is not going to be installed.

So this is the problem: The installed NVIDIA driver (and also those available in the repository) are not recent enough. Adding the xorg-edgers PPA helps:

sudo add-apt-repository ppa:xorg-edgers/ppa 
sudo apt-get update

Running the original sudo apt-get install cuda now works.

(This may not be a problem, if one runs the *.run file from the NVIDIA developer website.)

karel
  • 114,770
osdf
  • 171
  • 1
  • 5
4

From the terminal run:

sudo apt-get remove nvidia-cuda-*  # remove old nvidia-cuda packages
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb 
sudo apt-get update
sudo apt-get install cuda

Some actions must be taken after installing the CUDA Toolkit and Driver before they can be completely used. Perform the post-installation actions.


Ubuntu 16.04 and later

Open the terminal and type;

sudo apt remove --purge nvidia*
sudo apt remove --purge "nvidia*"
sudo apt remove nvidia-cuda-*  
sudo apt install nvidia-cuda-toolkit

Reference: NVIDIA CUDA Getting Started Guide for Linux v6.5

karel
  • 114,770
1

I had similar problem, for me it helped to make sure all other cuda and libcuda packages are removed.

List them with:

dpkg -l | grep cuda

If the list shows something, remove it with:

sudo apt-get remove <something>

After that install with the usual steps

sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
sudo apt-get update
sudo apt-get install cuda

Hope it helps.

Hohac
  • 11
  • 2
0

I encountered the same problem when upgrading from Ubuntu 12.04 to 14.04 and CUDA. I tried the above solutions, none of the packages listed was installed.

I solved it by removing nvidia-libopencl-* and nvidia-opencl-* packages.