Score:3

Dependency errors for any apt command

ro flag

When attempting to install or remove packages I am running into an error something to do with cuda.

For example, installing curl (which I already have installed):

sudo apt install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.58.0-2ubuntu3.16).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-libraries-dev-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= 10.2.2.89) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When doing this with a package that is not already installed it also gives those same missing dependencies (libcublas-dev) and fails to install.

Any help?

Edit: Trying sudo apt --fix-broken install gives a similar error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libcublas-dev
The following NEW packages will be installed:
  libcublas-dev
0 upgraded, 1 newly installed, 0 to remove and 613 not upgraded.
7 not fully installed or removed.
Need to get 0 B/42.3 MB of archives.
After this operation, 114 MB of additional disk space will be used.
Do you want to continue? [Y/n] y 
Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.40  libcublas-dev 10.2.2.89-1 [42.3 MB]
dpkg: warning: files list file for package 'cuda-libraries-10-2' missing; assuming package has no files currently installed
(Reading database ... 466055 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.2.2.89-1_amd64.deb ...
Unpacking libcublas-dev (10.2.2.89-1) ...
dpkg: error processing archive /var/cuda-repo-10-2-local-10.2.89-440.40/./libcublas-dev_10.2.2.89-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/cublas_v2.h', which is also in package nvidia-cuda-dev:amd64 10.0.130-0lambda3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cuda-repo-10-2-local-10.2.89-440.40/./libcublas-dev_10.2.2.89-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
cocomac avatar
cn flag
Try doing `sudo apt-get update && sudo apt-get install curl` and see if that works properly.
Kyle Carow avatar
ro flag
@cocomac Still getting the same error as shown above.
ScarletNyaa avatar
jp flag
Just to be sure, have you made any changes to your /etc/apt/sources.list?
user535733 avatar
cn flag
Looks like you tried to install Cuda more than one way, and did not clean up between the attempts. So you have conflicting packages floating around that sort-of work and soft-of don't. If that is indeed what happened, go back and clean up. Keep track of exactly what you install, when, and why -- that makes cleaning up much easier.
Kyle Carow avatar
ro flag
@user535733 Thanks for the insight - this machine was used by multiple people that seems likely. How would I go about fixing this?
Score:2
cn flag

Start with the key error line:

dpkg: error processing archive /var/cuda-repo-10-2-local-10.2.89-440.40/./libcublas-dev_10.2.2.89-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/cublas_v2.h', which is also in package nvidia-cuda-dev:amd64 10.0.130-0lambda3

Let's break that down a little bit:

dpkg: error processing PACKAGE A:
 trying to overwrite FILE, which is also in PACKAGE B

PACKAGE A = libcublas-dev:amd64 10.2.2.89-1
PACKAGE B = nvidia-cuda-dev:amd64 10.0.130-0lambda3
FILE      = /usr/include/cublas_v2.h

The first problem: Package A and Package B are trying to provide the same file. That means that the packages conflict. That conflict is what's causing the error.

The second problem: Look at the version numbers of each package...they don't match. They probably should.

  • You --the human admin-- must decide which version is appropriate for your system.

Take a look at apt cache policy for both of those packages. If the packages come from different sources, that's probably bad.

  • If you have multiple sources, you --the human admin-- must decide which source provides the appropriate packages for your system.

To fix the problem, you must make two decisions (in the bullets above). Then you must implement your decisions:

  1. Disable or delete the conflicting or unwanted sources. They are not helping you anyway.

  2. Uninstall conflicting or wrong-version packages.

It's also possible to use the quick-and-dirty --force-overwrite flag with apt so the error message goes away. However, I don't recommend that...it doesn't actually solve the underlying problem of mixed sources providing wrong-version packages, which might someday break Cuda entirely.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.