I am stuck with this error. Not able to install any RPMs. Please help
OS is RHEL6.9 64 bit
Thanks in advance.
This happens when you download and install xz from sources on a RHEL (or CentOS) 7 system. The problem is that the XZ_5.1.2alpha
label is not present in the released versions of xz, but it is present in the version RedHat ships and compiles against.
A small patch to the xz sources will fix the problem:
https://github.com/easybuilders/easybuild-easyconfigs/issues/4036
The patch is small enough to copy&paste here. I have used it on xz-5.2.4 successfully.
--- src/liblzma/liblzma.map.orig 2015-09-29 12:57:36.000000000 +0200
+++ src/liblzma/liblzma.map 2017-02-22 11:10:33.432868185 +0100
@@ -95,7 +95,13 @@
lzma_vli_size;
};
-XZ_5.2 {
+XZ_5.1.2alpha {
+global:
+ lzma_stream_encoder_mt;
+ lzma_stream_encoder_mt_memusage;
+} XZ_5.0;
+
+XZ_5.2.2 {
global:
lzma_block_uncomp_encode;
lzma_cputhreads;
@@ -105,4 +111,4 @@
local:
*;
-} XZ_5.0;
+} XZ_5.1.2alpha;
(update)
If you try to use this .so on CentOS 8, you will get unresolved symbols for XZ_5.2 (e.g. librpmio.so.8 wants lzma_stream_encoder_mt@XZ_5.2).
Here is a revised patch to create an liblzma.so.5 library that will work on both CentOS 7 and 8:
diff -u -r xz-5.2.5/src/liblzma/common/stream_encoder_mt.c xz-5.2.5-rhel7/src/liblzma/common/stream_encoder_mt.c
--- xz-5.2.5/src/liblzma/common/stream_encoder_mt.c 2020-03-17 07:28:50.000000000 -0700
+++ xz-5.2.5-rhel7/src/liblzma/common/stream_encoder_mt.c 2021-12-06 16:18:14.976457229 -0800
@@ -1141,3 +1141,9 @@
return total_memusage + outq_memusage;
}
+
+/* http://peeterjoot.com/2019/09/20/an-example-of-linux-glibc-symbol-versioning/ */
+__asm__(".symver lzma_stream_encoder_mt,lzma_stream_encoder_mt@XZ_5.1.2alpha");
+__asm__(".symver lzma_stream_encoder_mt,lzma_stream_encoder_mt@@XZ_5.2");
+__asm__(".symver lzma_stream_encoder_mt_memusage,lzma_stream_encoder_mt_memusage@XZ_5.1.2alpha");
+__asm__(".symver lzma_stream_encoder_mt_memusage,lzma_stream_encoder_mt_memusage@@XZ_5.2");
diff -u -r xz-5.2.5/src/liblzma/liblzma.map xz-5.2.5-rhel7/src/liblzma/liblzma.map
--- xz-5.2.5/src/liblzma/liblzma.map 2020-03-17 07:28:54.000000000 -0700
+++ xz-5.2.5-rhel7/src/liblzma/liblzma.map 2021-12-06 15:48:05.650672828 -0800
@@ -95,6 +95,12 @@
lzma_vli_size;
};
+XZ_5.1.2alpha {
+global:
+ lzma_stream_encoder_mt;
+ lzma_stream_encoder_mt_memusage;
+} XZ_5.0;
+
XZ_5.2 {
global:
lzma_block_uncomp_encode;
@@ -105,4 +111,4 @@
local:
*;
-} XZ_5.0;
+} XZ_5.1.2alpha;
I was stuck with similar problem since Nov 27, 2017 when I installed XZ Utils
5.2.3 from sources on CentOS 7.4 and copied liblzma.so.5.2.3
from /usr/local/lib/
to /lib64/
.
Cause of this problem is library librpmio.so.3
which requires symbol XZ_5.1.2alpha
to be defined in lzma shared library. liblzma.so.5.2.2
defines this symbol but liblzma.so.5.2.3
doesn't.
Without XZ update the most recent version of lzma library was 5.2.2 and I had symbolic link /lib64/liblzma.so.5
-> /lib64/liblzma.so.5.2.2
. After copying liblzma.so.5.2.3
and some further updates the link was changed to the most recent file i.e. /lib64/liblzma.so.5
-> /lib64/liblzma.so.5.2.3
. And that broke rpm
and yum
commands.
So, solution is:
Link /lib64/liblzma.so.5
back to /lib64/liblzma.so.5.2.2
:
cd /lib64
sudo ln -s -f liblzma.so.5.2.2 liblzma.so.5
Delete file /lib64/liblzma.so.5.2.3
Second possible cause might be environment variable LD_LIBRARY_PATH
. Check if it contains unwanted paths and clear it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With