nvidia-libopencl1-331 has to be removed before installing WINE

I just installed Ubuntu 14.04 64-bit and enabled the nvidia drivers. Now I am trying to install WINE but I get the message:

nvidia-libopencl1-331 has to be removed before installing WINE (translated from Dutch). Is this a bug? Or should I proceed removing this package?


The problem here is two packages are installing the same binary file '/usr/lib/*/libOpenCL.so' without declaring a breaks/replaces or conflicts relationship between them, and so apt-get does not know to remove the other. This either needs to be fixed in nvidia-cuda-toolkit or ocl-icd.

ocl-icd is shipping this file in ocl-icd-libopencl1 instead of ocl-icd-opencl-dev, which is against Debian policy, see https://bugs.debian.org/679228

nvidia-cuda-toolkit lists 'nvidia-opencl-dev (= 5.5.22-3ubuntu2~ppa1) | opencl-dev' among its dependencies, so as a workaround, we can help apt-get by installing ocl-icd-opencl-dev to provide opencl-dev, but we need to do it in the correct order:

sudo apt-get install nvidia-cuda-toolkit #Need to get 250 MB of archives; 774 MB of additional disk space will be used
sudo apt-get install ocl-icd-opencl-dev #this will remove nvidia-libopencl1-* and nvidia-opencl-dev
sudo apt-get install wine #Need to get 121 MB; 342 MB of additional disk space will be used.

https://bugs.launchpad.net/ubuntu/+source/ocl-icd/+bug/1247736/comments/7

https://www.kubuntuforums.net/showthread.php?65230-WINE-after-Internet-Upgrade-Path&p=349746


I received the same message after updating to 14.04 as well, and I'm just as curious to know why the nvidia-331 update package must be removed for WINE to work. In my case, this is not even an option, as it would break my current setup with switchable graphics. Hopefully, more information regarding this will emerge sooner or later.

For now, however, there are some workarounds.

It seems that only WINE 1.6 asks for removing the "nvidia-libopencl1-331" package. WINE 1.7.16, on the other hand, installs just fine, without the need for removal.

Though, if needed, it is possible to get WINE 1.6 working using PlayOnLinux. This without having to remove the mentioned package as well.

For now, this should hopefully be enough to get the desired Windows applications to run.