Proble with "nvidia-cuda-dev" unable to install

Asked by Gildas

# sudo apt-get install nvidia-cuda-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
  libnvcuvid1
The following NEW packages will be installed:
  nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
24 not fully installed or removed.
Need to get 0 B/201 MB of archives.
After this operation, 467 MB of additional disk space will be used.
(Reading database ... 248350 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (7.5.18-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/stubs/libcublas.so', which is also in package libcublas-dev 10.2.2.89-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can anyone help me ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nvidia-cuda-toolkit Edit question
Assignee:
No assignee Edit question
Solved by:
Gildas
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

This question has nothing to do with Launchpad hosting services, but seems to be related to packages on Ubuntu. So moved this question to the right target.

The error message indicates that you cannot install the package nvidia-cuda-dev and the package libcublas-dev at the same time. Are you sure that you need both packages installed?

This is similar to Bug #1819392

For diagnostic purposes please provide the output that you receive for the commands (to be executed in a terminal window):

uname -a
lsb_release -crid
apt-cache policy nvidia-cuda-dev libcublas-dev

Revision history for this message
Gildas (coderz) said :
#2

This is what i get :

~# uname -a
Linux coderz-HP-Pavilion-15-Notebook-PC 4.15.0-96-generic #97~16.04.1-Ubuntu SMP Wed Apr 1 03:03:31 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

~# lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

~# apt-cache policy nvidia-cuda-dev libcublas-dev
nvidia-cuda-dev:
  Installed: (none)
  Candidate: 7.5.18-0ubuntu1
  Version table:
     7.5.18-0ubuntu1 500
        500 http://tw.archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages
libcublas-dev:
  Installed: 10.2.2.89-1
  Candidate: 10.2.2.89-1
  Version table:
 *** 10.2.2.89-1 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
        100 /var/lib/dpkg/status
     10.2.1.243-1 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
     10.2.0.168-1 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
     10.2.0.163-1 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages
     10.1.0.105-1 500
        500 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 Packages

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

This confirms what I wrote.

You have the package libcublas-dev from nvidia.com.
You try to install the package nvidia-cuda-dev from the Ubuntu repositories.

These packages cannot be installed together.

For which purpose do you need both at the same time?

Revision history for this message
Gildas (coderz) said :
#4

I don't need both of these packages.

I only needed to install Cuba 9.0.
I looked up and found out i needed nvidia.

I used the drivers update ppa with 'sudo apt update'
I was supposed to see the nvidia driver in 'settings->software
updates->additional drivers' but it wasn't there.
'nvidia-msi' didn't work either.

I supposed that it was not needed.

Then i went for the installation of Cuba9.0 from the official website : i
followed the online method proposed by the website.

But the installation failed.

That is when i tried to it all again by purging the 'nvidia' and 'cuba'
packages via 'sudo apt purge', before reinstalling.

Then i started seeing this error.

I guess it is related to the fact that nvidia was not properly installed to
begin with.

On Tue, Apr 21, 2020, 23:32 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> This confirms what I wrote.
>
> You have the package libcublas-dev from nvidia.com.
> You try to install the package nvidia-cuda-dev from the Ubuntu
> repositories.
>
> These packages cannot be installed together.
>
> For which purpose do you need both at the same time?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

What is Cuba9.0, and what is it's "official website"?

Revision history for this message
Gildas (coderz) said :
#6

###Installing CUBA9.0

# Go to and follow instructions
https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=debnetwork

#Add the following line to

~/.bashrc export PATH=/usr/local/cuda/bin:$PATH export
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

On Wed, Apr 22, 2020, 00:14 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> What is Cuba9.0, and what is it's "official website"?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Gildas (coderz) said :
#7

###Install NVIDIA driver

##Via PPA

#Remove anything related to Nvidia.

sudo apt-get remove --purge nvidia*

sudo apt-get autoremove

#Install up-to-date NVIDIA drivers for your system.

sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt-get update (re-run if any warning/error messages)

#Check the installation by running

Nvidia-smi

On Wed, Apr 22, 2020, 00:14 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> What is Cuba9.0, and what is it's "official website"?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

CuBa or CuDa?

What you write is somewhat contradictory. You mention CUDA 9.0, but the package mentioned in your problem is version 10.2.2.89-1
Is there a reason that you use the older version 9 instead of the current 10.2.2 version?

How are your comments #6 and #7 related to each other?
For which reason do you need nvidia-cuda-dev from the Ubuntu repositories, if you take all Cuda software from the nvidia repositories? Where in the Nvidia instructions is is this mentioned?

Revision history for this message
Gildas (coderz) said :
#9

Its CUDA9.0, not CUBA, haha.
If you look at the webpage i sent for CUDA9.0 installation, you will see
that it is indeed CUDA9.0

The 10.2.2.89.1 version you are mentioning is ' libcublas-dev 10.2.2.89-1
' , which i don't know how it got there.

However i can ensure you that i didn't type any command for installing any
CUDA10 version. Or it was installed when i used “sudo apt update ”.

The problem is how to get around this conflict. Do you have any idea?

On Wed, Apr 22, 2020, 01:42 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> CuBa or CuDa?
>
> What you write is somewhat contradictory. You mention CUDA 9.0, but the
> package mentioned in your problem is version 10.2.2.89-1
> Is there a reason that you use the older version 9 instead of the current
> 10.2.2 version?
>
> How are your comments #6 and #7 related to each other?
> For which reason do you need nvidia-cuda-dev from the Ubuntu repositories,
> if you take all Cuda software from the nvidia repositories? Where in the
> Nvidia instructions is is this mentioned?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

Is there a reason that you use the older version 9 instead of the current 10.2.2 version of nvidia cuda?
see https://developer.nvidia.com/cuda-toolkit-archive

"The problem is how to get around this conflict."
Why do you need nvidia-cuda-dev from the Ubuntu repositories?

Revision history for this message
Gildas (coderz) said :
#11

I need the version 9.0 for a specific reason.

CUDA is not working properly so i need to remove it.
nvidia is also not properly installed, need to remove these two.
Each of them present an error asking to “ install nvidia-cuda-dev ”

This is where the problem starts.

# sudo apt-get install nvidia-cuda-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
  libnvcuvid1
The following NEW packages will be installed:
  nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
24 not fully installed or removed.
Need to get 0 B/201 MB of archives.
After this operation, 467 MB of additional disk space will be used.
(Reading database ... 248350 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (7.5.18-0ubuntu1) ...
dpkg: error processing archive
/var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb
(--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/stubs/libcublas.so', which
is also in package libcublas-dev 10.2.2.89-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

*Here are some specifics if you can help resolve the problem.*

~# uname -a
Linux coderz-HP-Pavilion-15-Notebook-PC 4.15.0-96-generic
#97~16.04.1-Ubuntu SMP Wed Apr 1 03:03:31 UTC 2020 x86_64 x86_64 x86_64
GNU/Linux

~# lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

~# apt-cache policy nvidia-cuda-dev libcublas-dev
nvidia-cuda-dev:
  Installed: (none)
  Candidate: 7.5.18-0ubuntu1
  Version table:
     7.5.18-0ubuntu1 500
        500 http://tw.archive.ubuntu.com/ubuntu xenial/multiverse amd64
Packages
libcublas-dev:
  Installed: 10.2.2.89-1
  Candidate: 10.2.2.89-1
  Version table:
 *** 10.2.2.89-1 500
        500
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64
Packages
        100 /var/lib/dpkg/status
     10.2.1.243-1 500
        500
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64
Packages
     10.2.0.168-1 500
        500
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64
Packages
     10.2.0.163-1 500
        500
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64
Packages
     10.1.0.105-1 500
        500
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64
Packages

On Wed, Apr 22, 2020, 02:13 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> Is there a reason that you use the older version 9 instead of the current
> 10.2.2 version of nvidia cuda?
> see https://developer.nvidia.com/cuda-toolkit-archive
>
> "The problem is how to get around this conflict."
> Why do you need nvidia-cuda-dev from the Ubuntu repositories?
>
> --
> To answer this request for more information, you can either reply to
> this email or enter your reply at the following page:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

Run the command

sudo dpkg --purge nvidia-cuda-dev

This should bring the package management system back into a sane status.

Revision history for this message
Gildas (coderz) said :
#13

Tried it :

dpkg : warning : ignoring request to remove nvidia-cuba-dev which isn't
installed

nvidia-cuba-dev is not installed, as mentioned in my previous comments.

On Wed, Apr 22, 2020, 02:47 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Status: Open => Answered
>
> Manfred Hampl proposed the following answer:
> Run the command
>
> sudo dpkg --purge nvidia-cuda-dev
>
> This should bring the package management system back into a sane status.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070/+confirm?answer_id=11
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> You received this question notification because you asked the question.
>

Revision history for this message
Gildas (coderz) said :
#14

I typed cuda, not cuba

Tried it :

dpkg : warning : ignoring request to remove nvidia-cuda-dev which isn't
installed

nvidia-cuda-dev is not installed, as mentioned in my previous comments.

Revision history for this message
Gildas (coderz) said :
#15

when i try to install it i get this :

~# apt-get install nvidia-cuda-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
  libnvcuvid1
The following NEW packages will be installed:
  nvidia-cuda-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
24 not fully installed or removed.
Need to get 0 B/201 MB of archives.
After this operation, 467 MB of additional disk space will be used.
(Reading database ... 248350 files and directories currently installed.)
Preparing to unpack .../nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb ...
Unpacking nvidia-cuda-dev (7.5.18-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/stubs/libcublas.so', which is also in package libcublas-dev 10.2.2.89-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-cuda-dev_7.5.18-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Gildas (coderz) said :
#16

I will just reinstall the whole system, this is dragging too much

Revision history for this message
Manfred Hampl (m-hampl) said :
#17

Try

sudo apt-get -o Dpkg::Options::="--force-overwrite" install nvidia-cuda-dev

Even when installing a new system from scratch, you cannot install libcublas-dev from nvidia.com and nvidia-cuda-dev from the Ubuntu repositories at the same time.

Revision history for this message
Gildas (coderz) said :
#18

Thank you very much for you time and help.
I already launched the resetting.

For installing CUDA, i need nvidia properly installed first, right?
What if after the installation via sudo, i cannot see nvidia driver in
...additional drivers ?

On Wed, Apr 22, 2020, 04:53 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Manfred Hampl posted a new comment:
> Try
>
> sudo apt-get -o Dpkg::Options::="--force-overwrite" install nvidia-cuda-
> dev
>
> Even when installing a new system from scratch, you cannot install
> libcublas-dev from nvidia.com and nvidia-cuda-dev from the Ubuntu
> repositories at the same time.
>
> --
> You received this question notification because you asked the question.
>

Revision history for this message
Manfred Hampl (m-hampl) said :
#19

Just follow the instructions for the nvidia cuda toolkit. If they tell to install certain packages, then do it. If they don't, then try without.

Revision history for this message
Gildas (coderz) said :
#20

Alright , thank you 👌

On Wed, Apr 22, 2020, 05:10 Manfred Hampl <
<email address hidden>> wrote:

> Your question #690070 on nvidia-cuda-toolkit in Ubuntu changed:
>
> https://answers.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+question/690070
>
> Manfred Hampl posted a new comment:
> Just follow the instructions for the nvidia cuda toolkit. If they tell
> to install certain packages, then do it. If they don't, then try
> without.
>
> --
> You received this question notification because you asked the question.
>