Following the installation of CUDA 9.2 I cannot use apt-get tools - I cannot install or remove any software. Tried to fix but failed...

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libglx-mesa0
The following packages will be upgraded:
  libglx-mesa0
1 to upgrade, 0 to newly install, 0 to remove and 27 not to upgrade.
Need to get 0 B/132 kB of archives.
After this operation, 0 B of additional disk space will be used.

Do you want to continue? [Y/n] Y

(Reading database ... 325459 files and directories currently installed.)
Preparing to unpack .../libglx-mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb ...
Unpacking libglx-mesa0:amd64 (18.0.5-0ubuntu0~18.04.1) over
(18.0.0~rc5-1ubuntu1) ...

dpkg: error processing archive /var/cache/apt/archives/libglx
mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0', which
is also in package nvidia-396 396.37-0ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/libglx-mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Reading other discussions I realized that I also do not have gcc 6 installed. However, I cannot fix this as apt-get fails regardless of installation:

sudo apt-get install gcc-6 g++-6
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:
 g++-6 : Depends: libstdc++-6-dev (= 6.4.0-17ubuntu1) but it is not going to be installed
 gcc-6 : Depends: cpp-6 (= 6.4.0-17ubuntu1) but it is not going to be installed
         Depends: libgcc-6-dev (= 6.4.0-17ubuntu1) but it is not going to be installed
 libglx-mesa0 : Depends: libglapi-mesa (= 18.0.0~rc5-1ubuntu1) but 18.0.5-0ubuntu0~18.04.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Is this going to require a re-installation of Lubuntu 18.

sudo apt-get update

Hit:1 http://au.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://au.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://au.archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:4 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64 InRelease
Hit:5 http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64 Release
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:8 http://archive.canonical.com/ubuntu bionic InRelease
Hit:9 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease Reading package lists... Done

sudo apt-get dist-upgrade -f

Reading package lists... Done Building dependency tree
Reading state information... Done Correcting dependencies... Done Calculating upgrade... Done The following packages will be upgraded: libglx-mesa0 1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. 64 not fully installed or removed. Need to get 0 B/132 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 361070 files and directories currently installed.) Preparing to unpack .../libglx-mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb ... Unpacking libglx-mesa0:amd64 (18.0.5-0ubuntu0~18.04.1) over (18.0.0~rc5-1ubuntu1) ... dpkg: error processing archive /var/cache/apt/archives/libglx-mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb (--unpack): trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0', which is also in package nvidia-396 396.37-0ubuntu1 Errors were encountered while processing: /var/cache/apt/archives/libglx-mesa0_18.0.5-0ubuntu0~18.04.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

apt-cache policy libglx-mesa0 libglapi-mesa nvidia-396 gcc-6 g++-6 cpp-6 libgcc-6-dev libstdc++-6-dev

  • Welcome to Ask Ubuntu! Could you please edit your question to include the output of sudo apt-get update; sudo apt-get dist-upgrade -f; apt-cache policy libglx-mesa0 libglapi-mesa nvidia-396 gcc-6 g++-6 cpp-6 libgcc-6-dev libstdc++-6-dev? Thanks. – David Foerster Jul 22 at 12:30
  • Hi David, cant post the results from the second and third query. I am being told I cant post more than 8 links. Is this due to me being a new member (so to speak)? – spada91 Jul 25 at 2:36
  • Please format code and command output listings as such (using the button with the {} symbol in the editor toolbar). URLs within code listings don't count towards the limit. Alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. – David Foerster Jul 25 at 5:06

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.