Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: gabor.strama on October 29, 2018, 09:33:29 am

Title: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: gabor.strama on October 29, 2018, 09:33:29 am
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! ;-)
Title: [SOLVED] Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: markus.neubauer on October 30, 2018, 08:37:54 am
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 (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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme on October 30, 2018, 10:28:10 am
https://answers.launchpad.net/ubuntu/+question/675775

I am in the starting stages of submitting a bug report,

See also, https://forum.zentyal.org/index.php?topic=32401.0
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme 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
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: markus.neubauer 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...
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: markus.neubauer 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme 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?
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: markus.neubauer 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)
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: J. A. Calvo 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.

Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: peptoniET 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: J. A. Calvo 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: peptoniET 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.
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: totor 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?
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: markus.neubauer on November 19, 2018, 11:04:33 am
The solution depends on your installation status.

Do you receive the error then use a bash shell and simply do:
Code: [Select]
A_VERSION=1.2.29
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 # instead force-all you may use force-downgrade
apt update
apt upgrade
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: ap1821 on December 13, 2018, 01:01:11 pm
This totally worked. Thanks markus!
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: Ppbottle on February 15, 2019, 10:32:04 pm
The solution from J. A. Calvo

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

Did not work for me, I got a 404 error.

Mrme's solution worked though and I am now up and running. Thank you!

Code: [Select]
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
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: mrme on March 15, 2019, 06:29:44 am
The solution from J. A. Calvo

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

Did not work for me, I got a 404 error.

Mrme's solution worked though and I am now up and running. Thank you!

Code: [Select]
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

I'm glad I was of service. How have you not noticed until now? I hate to think how you discovered this box wasn't being updated..
Title: Re: relocation error: /usr/lib/x86_64-linux-gnu/libapt-private.so.0.0:
Post by: cyber035 on September 21, 2019, 06:18:17 am
Can some one please post correct steps to upgrade from 5.1 to 5.3 and to 6.0 because no mater what i do and hold apt and libapt, dpkg goes dead and i cant update.