Ubuntu – Just updated the apt package on 16.04, now any apt command gives me a relocation error


Running apt update gives me this,

apt: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
symbol _ZN9pkgSystem9LockInnerEv, version APTPKG_5.0 not defined in file
libapt-pkg.so.5.0 with link time reference

In an attempt to fix this, I downloaded the apt package from here on packages.ubuntu.com, installed it with dpkg, ran apt upgrade and that told me to fix it with -f. I did that and it brought me back to the original issue. I assume there is a library issue here, but I am not sure what I need to update.

When I asked on reddit I was advised to reinstall; is this the best way to resolve this issue?

Any ideas on where to look or what to do to fix this?

As I cannot do this with apt, I would need to wget and dpkg any packages required to fix this, so please link me to the relevant sources, if applicable.

EDIT, I have contacted the Ubuntu bugtracker questions team and found a temporary fix, https://answers.launchpad.net/ubuntu/+question/675775

Best Answer

Today I had same problem after simple apt update && apt upgrade.

And i fixed it replacing /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0.0 from another Ubuntu 16.04 installation.