I am following the procedure given here :

However, after I do sudo apt-get install cuda I get the following message:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
cuda-drivers : Depends: nvidia-opencl-icd-346 (>= 346.46) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

After I enter sudo apt-get -f install I get the following message:

Preparing to unpack .../nvidia-opencl-icd-346_346.46-0ubuntu1_amd64.deb ...
Unpacking nvidia-opencl-icd-346 (346.46-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-opencl-icd-346_346.46-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/etc/OpenCL/vendors/nvidia.icd', which is also in package nvidia-opencl-icd-331 331.113-0ubuntu0.0.4
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

ask to remove the package.

How to do this ?

p.s. sudo apt-get install cuda-runtime-7-0 gives the same error.

2 Answers 2


I managed to get it working after running the following commands:

sudo apt-get clean  
sudo apt-get autoclean  
sudo apt-get autoremove  
sudo apt-get install -f  
  • You need to apt-get remove the old package v331 (or use autoremove like in the answer to fix after trying to install) because the installer somehow can't automatically do it for you.
    – pd12
    Apr 15, 2016 at 15:52

I was able to get rid of this error by first searching for the nvidia-opencl-icd-* files with the following command:

sudo find / -name nvidia-opencl-icd-\*

Then I removed all the files with the following prefix


and then ran:

sudo apt-get -f install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.