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 ?
sudo apt-get -o Dpkg::Options::="--force-overwrite" install <package-name>
– YellowishLight Feb 03 '19 at 18:05