0

I get this error after using the command:

keagan@KsPc:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libxss1:i386
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libgles1 libglvnd-dev
The following NEW packages will be installed:
  libgles1 libglvnd-dev
0 upgraded, 2 newly installed, 0 to remove and 37 not upgraded.
1 not fully installed or removed.
Need to get 0 B/14.6 kB of archives.
After this operation, 91.1 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 251820 files and directories currently installed.)
Preparing to unpack .../libgles1_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libgles1:amd64 (1.0.0-2ubuntu2.2) ...
dpkg: error processing archive /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1', which is also in package nvidia-340 340.106-0ubuntu3
Preparing to unpack .../libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libglvnd-dev:amd64 (1.0.0-2ubuntu2.2) ...
dpkg: error processing archive /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so', which is also in package nvidia-340 340.106-0ubuntu3
Errors were encountered while processing:
 /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb
 /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Im new to Linux and I have no idea what to do with problems like these Please help

mook765
  • 15,925

2 Answers2

1

here's what worked for me. I am running Ubuntu 18.04 and encountered a similar error.

When the fix-broken command doesn't work,

sudo apt --fix-broken install

you can always use dpkg to force an overwrite of the software that isn't working. This worked for me, allowed me to continue to update software on my install, and reboot without a problem. Try at your own risk. :)

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb

If that works, try re-running apt fix-install

sudo apt install -f

And then you may need to run this in addition to get the nvidia drivers to upgrade.

sudo dist-upgrade

Let me know how it goes.

Here is a source describing the same method, and another source.

  • Quoting from one of the links that you mention " This will effectively install the package but the problem remains when both package tries to use the same library/file/binary." The accepted answer at https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in shows perhaps a more sane method! – Charles Green Oct 04 '18 at 20:33
  • Thanks for the reply. In this case, the packages concerned are several different versions of nvidia drivers. It's possible that purging the nvidia drivers and reinstalling would help, but there's also a risk that users could wind up with no working graphics drivers.

    I can report with the identical error messages that this solution (1) addressed the error, (2) kept the graphics drivers intact, and (3) didn't require me to choose which drivers ought to be installed on my current system.

    – Ben Mazzotta Oct 15 '18 at 13:53
  • Removing the nvidia drivers should leave you with the software video display, which although slow, functions. The problem with the force option is outlined in one of the links: Some program is using outdated libraries or dependancies, and may fail when called upon. Not to be critical, as I have used the force option in the past myself, but as a general solution it can put a user into a bigger problem than the one they currently face. – Charles Green Oct 15 '18 at 14:00
  • Hi Charles, I see your point. Could you post a succinct answer detailing the specific packages that should be purged on Keagan's system (OP)? I suspect I'm not the only one that read about the dpkg -p solution and could not implement it. Which of the various nvidia packages could be safely purged? Purging the package scala will not help Keagan. Thanks for any advice. – Ben Mazzotta Oct 17 '18 at 14:21
  • I wish I could! My comment is more of a generality, and I run from a simple laptop so cannot do my usual - test things until they break. I'm not a computer science guy, but my experience running Linux on this laptop since 12.04 has taught me a few lessons! – Charles Green Oct 18 '18 at 13:36
0

https://bugs.launchpad.net/ubuntu/+source/libglvnd/+bug/1791542

You can either wait for the fix or update as per the link.

The nvidia-340.106 driver will be updated to 340.107

Sima
  • 1