0

Everytime I try to install any package from the package manager, I get the following error

 liblua5.2-0 : Breaks: liblua5.2-0:i386 (!= 5.2.4-1ubuntu1) but 5.2.0-2 is to be installed
 liblua5.2-0:i386 : Breaks: liblua5.2-0 (!= 5.2.0-2) but 5.2.4-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

When I run sudo apt-get -f install I get

Preparing to unpack .../liblua5.2-0_5.2.4-1ubuntu1_i386.deb ...
Unpacking liblua5.2-0:i386 (5.2.4-1ubuntu1) over (5.2.0-2) ...
dpkg: error processing archive /var/cache/apt/archives/liblua5.2-0_5.2.4-1ubuntu1_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/liblua5.2-0/copyright', which is different from other instances of package liblua5.2-0:i386
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Errors were encountered while processing:
 /var/cache/apt/archives/liblua5.2-0_5.2.4-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried various things such as clearing out the cache and installing from the package manager and still get the same error

2 Answers 2

0

Try aptitude instead of apt-get for a visual interface that will help you to diagnose what exactly goes wrong. The interface takes some time get used to, so don't get impatient and look around a bit first, and there's help to explain the keyboard commands.

As this error shows up for any package you try to install, it means your current configuration is inconsistent. When you start aptitude (as root), you should see a message that something is wrong, and there's a screen that gives you possible suggestions how to fix it (key ! "to examine"). Sometimes these suggestions work out, sometimes it is better to manually upgrade some packages to make the problem go away. In your case, that would be packages related to "lua" (key / to search for packages). Key i to install/upgrade a package, key b to jump to the next "broken" package. Key g to execute your choices.

Depending on the situation, it may take some fiddling before all broken packages are resolved. Also, first do an update (u) of available packages.

3
  • I don't aptitude on my machine I guess. I though that came standard? Sep 27, 2016 at 13:24
  • Looked it up: It was standard till Ubuntu 10.10, and still is for the server variant. You can still try: (1) Install aptitude manually (apt-get --download-only, dpkg -i on .deb file), (2) Try to remove the offending package liblua5.2-0, take note of what other packages that will remove, install aptitude and install those packages later, (3) apt-get install -f with various lua-related package names that should be upgraded, in the hope you hit the right combination.
    – dirkt
    Sep 27, 2016 at 14:28
  • I figured it out :) No idea why the system was unable to overwrite the documentation, but removing it first solved the issue Sep 27, 2016 at 15:03
0

I fixed it by running the following command in /usr/share/doc/liblua5.2-0

rm -f *

I then ran

sudo apt-get -f install

The problem has been fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.