2

I just really want to delete all of cuda and cudnn packages, but I cant use the apt-get at all because it always come with this mistake. Ive tried to much different things. Ive even located the broken package in synaptic, which is the nvidia-cuda-toolkit 9.1.85-3ubuntu1. I know maybes its a kind of silly problem, but im stuck at it. Help : ).

(base) itamar@itamar-PC:~$ sudo apt-get install nvidia-cuda-dev
Reading package lists... Done
Building dependency tree       
Reading state information... 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
  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.
Recommended packages:
  libvdpau-dev libnvcuvid1
The following NEW packages will be installed:
  nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 2 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.
Selecting previously unselected package nvidia-cuda-dev.
(Reading database ... 280498 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.2.89-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)



(base) itamar@itamar-PC:~$ sudo apt autoremove
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 installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
2
  • Your problem seems clearly stated in the output: 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.2.89-1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe). Uninstall BOTH of those packages.
    – user535733
    Nov 22, 2019 at 13:07
  • Does this answer your question? dpkg error: "trying to overwrite file, which is also in..."
    – karel
    Feb 15, 2020 at 17:28

2 Answers 2

2

I had the same issue. tried what user535733 recommended, but received an error. I did not have nvidia-cuda-dev installed, so I could not remove it. However, nvidia-cuda-toolkit was a dependency, so I removed that. That seems to have cleared up my issue, but now I do not have nvidia-cuda-toolkit! So that's no good for me but seems to be what @itamar-rocha was looking for. I was then able to sudo apt autoremove and clear up about 5GB of space.

I just wish nvidia-toolkit would install without conflicts and without over-writing other packages.

1

I had this issue for a while this is how I fixed it:

sudo dpkg -i --force-overwrite  /var/cache/apt/archives/nvidia-cuda-dev_9.1.85-3ubuntu1_amd64.deb
sudo apt --fix-broken install

To search for your cuda-dev version do ls on /var/cache/apt/archives/.
Hopefully this helps.

Not the answer you're looking for? Browse other questions tagged .