A new system with GPU was set up and I installed CUDA in it following the instructions given in nvidia website. Now I am trying to install vim. So I run the following
$ sudo apt-get install vim-runtime vim
and I get
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:
nvidia-cuda-toolkit : Depends: nvidia-cuda-dev (= 9.1.85-3ubuntu1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Running apt --fix-broken install
gives error message too:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libatomic1:i386 libbsd0:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386
libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libffi6:i386
libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386
libllvm7 libllvm8:i386 libnvidia-common-430 libpciaccess0:i386 libsensors4:i386 libstdc++6:i386
libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386
libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxshmfence1:i386 libxxf86vm1:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
nvidia-cuda-dev
Recommended packages:
libnvcuvid1
The following NEW packages will be installed:
nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 0 B/263 MB of archives.
After this operation, 734 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 229997 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (9.1.85-3ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb (--unpack):
trying to overwrite '/usr/include/cublas.h', which is also in package libcublas-dev 10.2.1.243-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have tried running sudo apt-get autoclean
, but it didnt solve it. I have a few questions apart from the solution i seek. Kindly bear with my naïvety and help me get rid if it :).
1) Its puzzling to me why a cuda package would affect other installations like vim. I feel like I am missing a general understanding about installation of packages in Ubuntu
2) Is it safe to overwrite the file /usr/include/cublas.h
?
3) Also please help me to understand the role of files in /var/cache/apt/archives/
directory in Ubuntu. Is it okay to delete the .deb files in them? And will deleting them resolve this issue?
Kindly let me know how to resolve this issue and install vim. I would be very grateful if someone could also explain (or point to the resources) the source of error and why some solution would work
I am using Ubuntu18.04 (edited)
nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb
package in/var/cache/apt/archives/
directory. Do I have to install the dependencies given in the link you have shared manually? – bigcrunch Oct 24 '19 at 07:54libcublas-dev
contains a conflict with packagenvidia-cuda-dev
which is your problem. I didn't see the first in Ubuntu repos, and it's dev didn't bother making it work with the other thus your issue or handle clashes. I would probably grab thecublas.h
file from each & see if they are different; if not copy & keep both & keep the 'best' (or amalgamate contents) & force package install; but I have no experience with that package so I'm not bet to advise. – guiverc Oct 24 '19 at 08:10