apt-get error: trying to overwrite shared 'filename', which is different from other instances of package 'package'

12,342

Solution 1

In the end, I moved the directory with the problematic files:

sudo mv /usr/share/doc/libqtwebkit4 /usr/share/doc/libqtwebkit4.backup

After that apt-get -f install ran successfully.

Solution 2

I tried installing several Ubuntu packages on Debian Wheezy

There's your problem: Ubuntu and Debian use the same package format, but you can't so easily mix Debian and Ubuntu packages on the same system, because the releases have different versions of the packages. You'd get similar issues if you mixed multiple releases of Debian or of Ubuntu. It can be done sometimes, mostly if you install leaf packages (packages that no other package depends on), but it isn't recommended.

More specifically, the problem here is that you have different versions of the libqtwebkit4 package installed, for different architectures (i386 and amd64). You need to have the same version for both architectures. apt-get install libqtwebkit4 libqtwebkit4:i386 might fix this, though it's possible that you've reached a state where manual fiddling is required. In principle, if you reached this state with only APT then APT should be able to get you out of it. On the other hand, if you called dpkg manually then it is expected that some manual fixing may be required.

Share:
12,342

Related videos on Youtube

sashoalm
Author by

sashoalm

Updated on September 18, 2022

Comments

  • sashoalm
    sashoalm over 1 year

    I tried installing several Ubuntu packages on Debian Wheezy, but it failed and now I have broken packages.

    The problem is, running apt-get -f install fails as well, with this error:

    Preparing to replace libqtwebkit4:amd64 2.2.1-1ubuntu4 (using .../libqtwebkit4_2.2.1-5_amd64.deb) ...
    Unpacking replacement libqtwebkit4:amd64 ...
    dpkg: error processing /var/cache/apt/archives/libqtwebkit4_2.2.1-5_amd64.deb (--unpack):
     trying to overwrite shared '/usr/share/doc/libqtwebkit4/changelog.Debian.gz', which is different from other instances of package libqtwebkit4:amd64
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    

    It seems to be complaining about overwriting some files. Should I try deleting or moving those files?

  • sashoalm
    sashoalm about 10 years
    Yes, unfortunately I realized that too late.
  • Billy Pilgrim
    Billy Pilgrim over 6 years
    Thank you from 2017! I've been losing sleep over this one and now I've finally made some progress.
  • Kevkeev13
    Kevkeev13 about 5 years
    thank you this solves another known bug with ubuntu 16 LTS posted here, libtiffxx5 4.0.6-1ubuntu0.6.
  • scottmsul
    scottmsul over 3 years
    I think the "Debian" way to do this would be `dpkg-divert /path/to/annoying/file', which worked for me.