2

I am trying to install nvidia-docker (https://github.com/NVIDIA/nvidia-docker) and when I run:

sudo apt-get install -y nvidia-container-toolkit

I get:

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:
 cuda-drivers : Depends: nvidia-compute-utils-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-dkms-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-driver-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-kernel-common-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-kernel-source-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-utils-418 (>= 418.67) but it is not going to be installed
                Depends: xserver-xorg-video-nvidia-418 (>= 418.67) but it is not going to be installed
 libnvidia-gl-418 : Depends: libnvidia-gl-430 but it is not going to be installed
 libnvidia-ifr1-430 : Depends: libnvidia-gl-430 but it is not going to be installed
 nvidia-container-toolkit : Depends: libnvidia-container-tools (>= 0.1.0) but it is not going to be installed
                            Depends: libnvidia-container-tools (< 2.0.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Now if I do:

sudo apt --fix-broken install

I get:

Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  lib32gcc1 libc6-i386 ocl-icd-libopencl1 xserver-xorg-legacy
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-cfg1-430 libnvidia-gl-430 nvidia-compute-utils-418 nvidia-compute-utils-430 nvidia-dkms-418 nvidia-dkms-430 nvidia-driver-418 nvidia-driver-430
  nvidia-kernel-common-418 nvidia-kernel-common-430 nvidia-kernel-source-418 nvidia-kernel-source-430 nvidia-utils-418 nvidia-utils-430
  xserver-xorg-video-nvidia-418 xserver-xorg-video-nvidia-430
Recommended packages:
  libnvidia-compute-430:i386 libnvidia-decode-430:i386 libnvidia-encode-430:i386 libnvidia-ifr1-430:i386 libnvidia-fbc1-430:i386 libnvidia-gl-430:i386
The following packages will be REMOVED:
  nvidia-418 nvidia-418-dev
The following NEW packages will be installed:
  libnvidia-cfg1-430 libnvidia-gl-430 nvidia-compute-utils-418 nvidia-compute-utils-430 nvidia-dkms-418 nvidia-dkms-430 nvidia-driver-418 nvidia-driver-430
  nvidia-kernel-common-418 nvidia-kernel-common-430 nvidia-kernel-source-418 nvidia-kernel-source-430 nvidia-utils-418 nvidia-utils-430
  xserver-xorg-video-nvidia-418 xserver-xorg-video-nvidia-430
0 upgraded, 16 newly installed, 2 to remove and 11 not upgraded.
6 not fully installed or removed.
Need to get 0 B/47.2 MB of archives.
After this operation, 228 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 117044 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-430_430.40-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking libnvidia-gl-430:amd64 (430.40-0ubuntu0~gpu18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-430_430.40-0ubuntu0~gpu18.04.1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/glvnd/egl_vendor.d/10_nvidia.json', which is also in package nvidia-418 418.67-0ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-430_430.40-0ubuntu0~gpu18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

and the problem doesn't solve.

I've tried several things: install everything with the -f parameter, trying to purge the cuda drivers, install aptitude, but all of them give me dependencies error. For example, if I try to install aptitude, (with sudo apt-get install aptitude) I get:

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:
 aptitude : Depends: aptitude-common (= 0.8.10-6ubuntu1) but it is not going to be installed
            Depends: libboost-filesystem1.65.1 but it is not going to be installed
            Depends: libboost-iostreams1.65.1 but it is not going to be installed
            Depends: libboost-system1.65.1 but it is not going to be installed
            Depends: libcwidget3v5 but it is not going to be installed
            Depends: libsigc++-2.0-0v5 (>= 2.8.0) but it is not going to be installed
            Depends: libxapian30 but it is not going to be installed
            Recommends: libparse-debianchangelog-perl but it is not going to be installed
 cuda-drivers : Depends: nvidia-compute-utils-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-dkms-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-driver-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-kernel-common-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-kernel-source-418 (>= 418.67) but it is not going to be installed
                Depends: nvidia-utils-418 (>= 418.67) but it is not going to be installed
                Depends: xserver-xorg-video-nvidia-418 (>= 418.67) but it is not going to be installed
 libnvidia-gl-418 : Depends: libnvidia-gl-430 but it is not going to be installed
 libnvidia-ifr1-430 : Depends: libnvidia-gl-430 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

which of course doesn't get fixed with the suggested apt --fix-broken install.

I've got installed the CUDA drivers version 10.1:

Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:10:27_PDT_2019
Cuda compilation tools, release 10.1, V10.1.168

if that helps.

Any help would be much appreciated. Thanks!

  • 1
    The problem seems clearly stated in your output: "Unpacking libnvidia-gl-430:amd64 (430.40-0ubuntu0~gpu18.04.1) ... dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-430_430.40-0ubuntu0~gpu18.04.1_amd64.deb (--unpack): trying to overwrite '/usr/share/glvnd/egl_vendor.d/10_nvidia.json', which is also in package nvidia-418 418.67-0ubuntu1" Those two packages conflict and cannot be installed at the same time. You must make an executive decision between the two, and stop trying to have both installed. – user535733 Aug 07 '19 at 14:57
  • Thanks! So I believe 418 corresponds to CUDA 10.1, so I have to nuke the 430. How can I do that? (I tried already to purge the cuda drivers, but got similar error). – Escachator Aug 07 '19 at 15:06

2 Answers2

0

I ran into a similar situation last weekend upgrading Ubuntu 16.04.6 LTS to Ubuntu 19.04 on a cloned partition. You might want to try this fix on a clone too. To create a clone see:

This answer relating to nvidia Cuda is similar to what I did and what you can try (it is a bit risky):

Your command would be like this:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libnvidia-gl-430_430.40-0ubuntu0~gpu18.04.1_amd64.deb
  • Thanks! However, I get the following error:
    dpkg: error processing package libnvidia-gl-430:amd64 (--install):
     dependency problems - leaving unconfigured
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    Errors were encountered while processing:
     libnvidia-gl-430:amd64
    
    – Escachator Aug 13 '19 at 16:03
  • Try sudo apt install -f a couple of times to see if dependency problems work themselves out on their own. – WinEunuuchs2Unix Aug 13 '19 at 17:07
0

Disclaimer: Use this as a last resort. This might make your NVIDIA drivers become corrupted.

Just remove the problem:

sudo rm -rf /usr/share/glvnd/egl_vendor.d/10_nvidia.json
sudo apt -f install    
Olimjon
  • 7,292