Author Topic: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:  (Read 3559 times)

gabor.strama

  • Zen Apprentice
  • *
  • Posts: 19
  • Karma: +2/-0
    • View Profile
Hi!

Currently if you upgrade the libapt-pkg5.0 to the latest version, in this case you got the followin error message when you try to run some upgrade ( apt update, deselect update menu, etc ). The only solution what is work for me if i downgrade the libapt-pkg5.0.

Here is the link what is good for me.
http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_1.2.29_amd64.deb

Have a nice day, and error free syslog! ;-)

markus.neubauer

  • Zen Apprentice
  • *
  • Posts: 49
  • Karma: +7/-0
    • View Profile
Try apt-get update
You are affected if the response is:
Quote
apt-get: 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
Problem: From here on your system will never update again!

It occured after the last update see /var/log/apt/history.log within 5.1 (example):
Quote
Start-Date: 2018-10-26  20:11:39
Commandline: apt-get -o DPkg::Options::=--force-confold --yes --force-yes --no-install-recommends install apt ap
Requested-By: ebox (111)
Upgrade: apt:amd64 (1.2.27, 1.2.29), apt-utils:amd64 (1.2.27, 1.2.29), apt-transport-https:amd64 (1.2.27, 1.2.29
End-Date: 2018-10-26  20:11:47

Solution: This is a case which you have to fix manually by your own. Use sudo or root for execution.
(Solution from gabor.strama gives the right direction!)

In detail, put this to a bash shell with root access:
Code: [Select]
A_VERSION=1.2.29 # see log obove
cd /var/cache/apt/archives
if [ 'x86_64' == "`uname -m`" ]; then
  # on 64-Bit System use:
  wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_${A_VERSION}_amd64.deb
  dpkg --install --force-all libapt-pkg5.0_${A_VERSION}_amd64.deb
else
  # on i386 System use:
  wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_${A_VERSION}_i386.deb
  dpkg --install --force-all libapt-pkg5.0_${A_VERSION}_i386.deb
fi
You do not need to continue here, continue and read the comment at the end from "J. A. Calvo" -> https://forum.zentyal.org/index.php/topic,32403.msg109058.html#msg109058


A method to hold/pin the package after downgrading using preferences (not prefrerred any more):
Code: [Select]
# Prevent updates temporary
apt-mark hold libapt-pkg5.0

cat << EOT > /etc/apt/preferences.d/libapt
Package: Package: libapt-pkg5.0
Pin: release a=xenial*
Pin-Priority: 1000

Package: Package: libapt-inst2.0
Pin: release a=xenial*
Pin-Priority: 1000
EOT
apt-mark unhold libapt-pkg5.0
# test
apt upgrade
Now, only a Ubuntu xenial release will update the packages.

To clearify: Zentyal is responsible to fix this issue or the systems won't even get security updates. It's in Zentyal's hand providing information on this case and release a script to fix this issue for the installed base. Furthermore Zentyal has to include a step in the upgrade procedure from 5.1 -> 6.0 +f that removes the file /etc/apt/preferences.d/libapt again.
« Last Edit: October 31, 2018, 10:49:27 am by markus.neubauer »

mrme

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #2 on: October 30, 2018, 10:28:10 am »

mrme

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #3 on: October 30, 2018, 11:56:00 am »
Try these commands,
wget https://launchpad.net/ubuntu/+archive/primary/+files/libapt-pkg5.0_1.2.29_amd64.deb
sudo dpkg --install --force-downgrade libapt-pkg5.0_1.2.29_amd64.deb

markus.neubauer

  • Zen Apprentice
  • *
  • Posts: 49
  • Karma: +7/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #4 on: October 30, 2018, 12:01:10 pm »
Try these commands,
wget https://launchpad.net/ubuntu/+archive/primary/+files/libapt-pkg5.0_1.2.29_amd64.deb
sudo dpkg --install --force-downgrade libapt-pkg5.0_1.2.29_amd64.deb
;) and dont forget to hold the package (see before) or you will run in the same issue again...
« Last Edit: October 30, 2018, 12:04:42 pm by markus.neubauer »

mrme

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #5 on: October 30, 2018, 12:57:42 pm »
Those commands I ran in a VM, same state as the machine I noticed the issue on and running apt update/upgrade after reboot,I get told by apt that libapt-pkg5.0 is held back. About to apply this to the box I noticed it on, will report on actual, in use hardware after reboot.

markus.neubauer

  • Zen Apprentice
  • *
  • Posts: 49
  • Karma: +7/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #6 on: October 30, 2018, 01:13:33 pm »
Use pinning to release (see above) and you will not get any more held information on this. Upgrades in this case will be done using the major release.
« Last Edit: October 30, 2018, 01:16:18 pm by markus.neubauer »

mrme

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #7 on: October 30, 2018, 01:21:41 pm »
Seems to be fixed? https://i.imgur.com/Fb8cxI3.png

What steps would you suggest I take?

markus.neubauer

  • Zen Apprentice
  • *
  • Posts: 49
  • Karma: +7/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #8 on: October 30, 2018, 01:31:01 pm »
I'd suggest using pinning (preferences.d)!

It's up to Zentyal now, they have to inform their users, as it is a security issue, and describe a manual way to bring their system's back to real life (also community version). Sorry to say that, but a system with no security updates should be shut down (more or less early) -> I'm a hardliner in this  8)
« Last Edit: October 30, 2018, 01:49:02 pm by markus.neubauer »

mrme

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #9 on: October 30, 2018, 02:15:41 pm »
I have closed off access to the machine through forwarded ports, and disabled external connections through the router, I have also ran apt-mark hold libapt-pkg5.0

I agree, the box should not be up, but I will keep an eye on the state of the machine and keep an eye on logins over SSH as well as any other HTTP / HTTPS service logs over the next few days. I hope there's a fix soon.

J. A. Calvo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1986
  • Karma: +67/-3
    • View Profile
    • http://blogs.zentyal.org/jacalvo
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #10 on: October 31, 2018, 10:29:37 am »
Hi,

We've fixed archive.zentyal.org removing the conflicting packages with the new ones in the Ubuntu 16.04 repos and this should not happen again in fresh installs.

For already broken installations the fix, as pointed out here, is:

Code: [Select]
wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg5.0_1.2.29_amd64.deb
sudo dpkg --install --force-downgrade libapt-pkg5.0_1.2.29_amd64.deb

And after that, as zentyal repo is already fixed, upgrades should work now normally, without need of pining or holding any package.

Thanks for reporting!!

PS: Please also note that Zentyal 6.0, which was released yesterday and is based on Ubuntu 18.04, was not affected at all: The problem in Zentyal 5.1 was caused due to the dependencies introduced for having Samba 4.6 (the Samba version in the official Ubuntu repos was 4.3). In Zentyal 6.0 we are no longer backporting packages, we just depend on the Samba 4.7 packages included in the Ubuntu 18.04 repos (this would be also our policy for all future releases). So, installing Zentyal 6.0 would be the recommended option for fresh installs anyway, as it should not be affected for these kind of issues in the future and just receive updates from Ubuntu normally.

« Last Edit: October 31, 2018, 05:33:20 pm by J. A. Calvo »
Zentyal Server Lead Developer

peptoniET

  • Zen Apprentice
  • *
  • Posts: 27
  • Karma: +4/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #11 on: October 31, 2018, 03:33:56 pm »
Great news to know you have solved your mistake.  Yesterday I found the solution on my own, after several hours fighting, and having several servers afected.

By the way, you might like to correct your quote about a solution:  you are missing a "wget".  The original poster did include the wget.

Would you care to explain exactly what happened to the repositories you maintain?  What was the procedure that went wrong?  This is a relevant error and the community would be grateful if you could explain, not only what went wrong, but what did/will you do to ensure it will not happen again.

I'm sure a complete explanation from you will benefit the Zentyal organization, showing a transparent communication.

Thanks in advance.

J. A. Calvo

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1986
  • Karma: +67/-3
    • View Profile
    • http://blogs.zentyal.org/jacalvo
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #12 on: October 31, 2018, 05:46:42 pm »
Thanks for pointing the missing wget, I've edited the post.

About the Zentyal 5.1 repositories, nothing "happened" to them, there was no change at all in their content in the last days (mainly because the team was focused in the release of Zentyal 6.0). In fact, those "conflicting packages" (libapt-pkg5.0 and libapt-inst2.0) have been there for a full year (introduced as dependencies of the samba 4.7 packages from a newer version of Ubuntu before the release of Zentyal 5.1) causing no problem at all during this whole year.

The problem arose the other day as a result of the release of newer apt packages to the Ubuntu xenial-updates repo, and as the version from libapt-pkg5.0 in the Zentyal repo was greater than the correct one in xenial-updates, apt was left in a broken state after the upgrade. The solution has been just deleting those packages from the repo, as they were no longer needed because currently with the newer packages from Ubuntu all the dependencies were already satisfied.

Finally, as I said in my previous post, the "real fix" is not having any packages with newer version in the Zentyal repo than in the Ubuntu ones in the newest Zentyal 6.0, so this release is definitely "protected" against these problems.

Hope this clarifies the issue.
Zentyal Server Lead Developer

peptoniET

  • Zen Apprentice
  • *
  • Posts: 27
  • Karma: +4/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #13 on: October 31, 2018, 06:12:38 pm »
Thanks for pointing the missing wget, I've edited the post.

About the Zentyal 5.1 repositories, nothing "happened" to them, there was no change at all in their content in the last days (mainly because the team was focused in the release of Zentyal 6.0). In fact, those "conflicting packages" (libapt-pkg5.0 and libapt-inst2.0) have been there for a full year (introduced as dependencies of the samba 4.7 packages from a newer version of Ubuntu before the release of Zentyal 5.1) causing no problem at all during this whole year.

The problem arose the other day as a result of the release of newer apt packages to the Ubuntu xenial-updates repo, and as the version from libapt-pkg5.0 in the Zentyal repo was greater than the correct one in xenial-updates, apt was left in a broken state after the upgrade. The solution has been just deleting those packages from the repo, as they were no longer needed because currently with the newer packages from Ubuntu all the dependencies were already satisfied.

Finally, as I said in my previous post, the "real fix" is not having any packages with newer version in the Zentyal repo than in the Ubuntu ones in the newest Zentyal 6.0, so this release is definitely "protected" against these problems.

Hope this clarifies the issue.

Hi,

For me, it does clarify very well.  Thanks for you prompt and clear answer.  Sure it means a lot to the community who relies in a stable Zentyal.

thanks a lot.

Gracias por tu buen talante.

totor

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
« Reply #14 on: November 19, 2018, 10:54:45 am »
Hello all

I try your solution but it didn't resolve the issue on my community installation.
Someone can help me please? What information do you need?