0

I have just broken my dependency tree after doing :

sudo apt-get update
sudo apt-get upgrade

Now when I try installing anything, I get the following error

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:
 ffmpeg : Depends: libavdevice57 (>= 7:3.4.4) but it is not going to be installed
          Depends: libsdl2-2.0-0 (>= 2.0.8) but it is not going to be installed
 libglx-mesa0 : Depends: libglapi-mesa (= 18.0.5-0ubuntu0~18.04.1) but 18.2.2-0ubuntu1~18.04.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When I try

sudo apt --fix-broken install

I get the following error

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 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
37 not fully installed or removed.
Need to get 0 B/134 kB of archives.
After this operation, 9 216 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 238586 files and directories currently installed.)
Preparing to unpack .../libglx-mesa0_18.2.2-0ubuntu1~18.04.1_amd64.deb ...
Unpacking libglx-mesa0:amd64 (18.2.2-0ubuntu1~18.04.1) over (18.0.5-0ubuntu0~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libglx-mesa0_18.2.2-0ubuntu1~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.44-0ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/libglx-mesa0_18.2.2-0ubuntu1~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to install libglx-mesa0 through

sudo apt-get install libglx-mesa0

But I get the following error

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  libglx-mesa0
1 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
37 not fully installed or removed.
Need to get 134 kB of archives.
After this operation, 9 216 B of additional disk space will be used.
Get:1 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libglx-mesa0 amd64 18.2.2-0ubuntu1~18.04.1 [134 kB]
Fetched 134 kB in 0s (895 kB/s)       
(Reading database ... 238586 files and directories currently installed.)
Preparing to unpack .../libglx-mesa0_18.2.2-0ubuntu1~18.04.1_amd64.deb ...
Unpacking libglx-mesa0:amd64 (18.2.2-0ubuntu1~18.04.1) over (18.0.5-0ubuntu0~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libglx-mesa0_18.2.2-0ubuntu1~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.44-0ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/libglx-mesa0_18.2.2-0ubuntu1~18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Can you help me to repair it, please ?

1 Answers1

0

Had similar problems while trying to install Nvidia drivers.

sudo apt purge nvidia*

Switch back to driver nouveau and reboot (at this point your dependency issue should be fixed)

While rebooting press SHIFT key, this will bring up GRUB bootloader.

Once in GRUB press "e" key to edit default entry and add "nomodeset" right before "quiet splash"

Once logged in install the Nvidia drivers again, possibly (if you have GUI) use the "Additional Drivers" tab from Software Updates utility in Ubuntu. I'm using Nvidia 410 and I suggest you doing the same if you don't have any special needs.

Edit: if you need CUDA + NVIDIA 410:

sudo apt-key adv --fetch-keys  http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt update
sudo apt install nvidia-driver-410
sudo apt install cuda-10-0

If you want just CUDA skip the installation of nvidia-driver-410