Shared object "liblzma.so.0" not found, required by "xsltproc"

dvl@

Developer
I have moved a jail from an 8.4 host to a 9.2 host. I did a portupgrade -fa after the move. The main problem occurs while trying to install git:

Code:
[dan@mysql55:/usr/ports/devel/git] $ sudo make install
===>  Installing for git-1.8.3.4
===>   git-1.8.3.4 depends on package: p5-Error>=0 - found
...
...
install -m 755 git-subtree /usr/local/libexec/git-core
xmlto -m ../../Documentation/manpage-normal.xsl  man git-subtree.xml
Shared object "liblzma.so.0" not found, required by "xsltproc"
gmake: *** [git-subtree.1] Error 1
*** [post-install] Error code 2

Stop in /basejail/usr/ports/devel/git.
*** [install] Error code 1

Stop in /basejail/usr/ports/devel/git.

Looking closer:

Code:
 $ ldd /usr/local/bin/xsltproc
/usr/local/bin/xsltproc:
        libxslt.so.2 => /usr/local/lib/libxslt.so.2 (0x80081d000)
        libexslt.so.8 => /usr/local/lib/libexslt.so.8 (0x800a57000)
        libgcrypt.so.19 => /usr/local/lib/libgcrypt.so.19 (0x800c6a000)
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800ee7000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x8010ea000)
        libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x8012f4000)
        liblzma.so.0 => not found (0)
        libz.so.6 => /lib/libz.so.6 (0x801648000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libm.so.5 => /lib/libm.so.5 (0x801b58000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
        liblzma.so.0 => not found (0)
        liblzma.so.0 => not found (0)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x8020cc000)

Suggestions please?
 
I think you need to remove archivers/xz and rebuild everything that depended on it. If I recall correctly the base now has support for LZMA compression and the port isn't needed anymore.
 
For the record:

Code:
$ ldd -a /usr/local/bin/xsltproc
/usr/local/bin/xsltproc:
        libxslt.so.2 => /usr/local/lib/libxslt.so.2 (0x80081d000)
        libexslt.so.8 => /usr/local/lib/libexslt.so.8 (0x800a57000)
        libgcrypt.so.19 => /usr/local/lib/libgcrypt.so.19 (0x800c6a000)
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800ee7000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x8010ea000)
        libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x8012f4000)
        liblzma.so.0 => not found (0)
        libz.so.6 => /lib/libz.so.6 (0x801648000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libm.so.5 => /lib/libm.so.5 (0x801b58000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libxslt.so.2:
        libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x8012f4000)
        liblzma.so.0 => not found (0)
        libz.so.6 => /lib/libz.so.6 (0x801648000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libm.so.5 => /lib/libm.so.5 (0x801b58000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libexslt.so.8:
        libxslt.so.2 => /usr/local/lib/libxslt.so.2 (0x80081d000)
        libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x8012f4000)
        liblzma.so.0 => not found (0)
        libz.so.6 => /lib/libz.so.6 (0x801648000)
        libm.so.5 => /lib/libm.so.5 (0x801b58000)
        libgcrypt.so.19 => /usr/local/lib/libgcrypt.so.19 (0x800c6a000)
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800ee7000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x8010ea000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libgcrypt.so.19:
        libgpg-error.so.0 => /usr/local/lib/libgpg-error.so.0 (0x800ee7000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x8010ea000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libgpg-error.so.0:
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x8010ea000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libintl.so.9:
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libxml2.so.5:
        libz.so.6 => /lib/libz.so.6 (0x801648000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x8020cc000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80185c000)
        libm.so.5 => /lib/libm.so.5 (0x801b58000)
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/lib/libz.so.6:
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/local/lib/libiconv.so.3:
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/lib/libm.so.5:
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
/usr/lib/liblzma.so.5:
        libc.so.7 => /lib/libc.so.7 (0x801d79000)
 
SirDice said:
I think you need to remove archivers/xz and rebuild everything that depended on it. If I recall correctly the base now has support for LZMA compression and the port isn't needed anymore.

There is no xz installed at present. That's not to say it wasn't installed earlier. I recall removing that from somewhere, and it might have been here.
 
The script might need /usr/lib added, but I'm not sure if a symlink would be the problem. Although I don't know how else a port would build if a library really is missing. Assuming you have a locate(1) database built, does it find liblzma.so.0 anywhere?
 
FreeBSD 9.2 has liblzma.so.5 not liblzma.so.0. The problem is probably in one or more of the dependencies of textproc/libxslt that is still depending on the 8.4 version of the liblzma library and needs to be rebuilt before textproc/libxslt can be rebuilt properly.
 
Is the portupgrade command guaranteed to rebuild everything? I don't use it myself so I don't really know what it can do.

It's very tricky to rebuild everything correctly in one go unless you use a package builder like ports-mgmt/poudriere, that's why even ports-mgmt/portmaster has a rather involved procedure for rebuilding everything.
 
wblock@ said:
The script might need /usr/lib added, but I'm not sure if a symlink would be the problem. Although I don't know how else a port would build if a library really is missing. Assuming you have a locate(1) database built, does it find liblzma.so.0 anywhere?

It does not find it.
 
Well it must have missed something. I would just grep(1) for the binary/library that is still depending on the old library and see what package the files belong to:

grep -lr liblzma.so.0 /usr/local/bin /usr/local/sbin /usr/local/lib /usr/local/libexec

Edit: Repeat for /bin, /sbin, /usr/bin, /usr/sbin, /usr/lib and /usr/libexec in case it's some weird dependency in the base system that has not been updated properly.
 
Code:
 $ grep -lr liblzma.so.0 /usr/local/bin /usr/local/sbin /usr/local/lib /usr/local/libexec
/usr/local/bin/xsltproc
/usr/local/bin/lzma
/usr/local/bin/lzcat
/usr/local/bin/unxz
/usr/local/bin/xzcat
/usr/local/bin/unlzma
/usr/local/lib/libexslt.so
/usr/local/lib/libxslt.so.2
/usr/local/lib/libexslt.so.8
/usr/local/lib/liblzma.so
/usr/local/lib/libxslt.so
 
Following on from that, in reverse order of the output:

Code:
[dan@mysql51:~] $ pkg_info -W /usr/local/lib/libxslt.so
/usr/local/lib/libxslt.so was installed by package libxslt-1.1.28_1
[dan@mysql51:~] $ pkg_info -W /usr/local/lib/liblzma.so
[dan@mysql51:~] $ pkg_info -W /usr/local/lib/libexslt.so.8
/usr/local/lib/libexslt.so.8 was installed by package libxslt-1.1.28_1
[dan@mysql51:~] $ pkg_info -W /usr/local/lib/libxslt.so.2
/usr/local/lib/libxslt.so.2 was installed by package libxslt-1.1.28_1
[dan@mysql51:~] $ pkg_info -W /usr/local/lib/libexslt.so
/usr/local/lib/libexslt.so was installed by package libxslt-1.1.28_1
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/unlzma
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/xzcat
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/unxz
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/lzcat
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/lzma
[dan@mysql51:~] $ pkg_info -W /usr/local/bin/xsltproc
/usr/local/bin/xsltproc was installed by package libxslt-1.1.28_1
[dan@mysql51:~] $
 
Wait, you just said it didn't find it, but there it is! Use pkg_info -W /usr/local/lib/liblzma.so to see where that file came from. I'll bet it's an orphan that got copied over but should not have been.
 
Simulpost... Yes, it looks like usr/local/lib/liblzma.so should not be there. It's not part of a package.
 
I said it didn't find liblzma.so.0

Code:
$ locate liblzma.so.0
$ locate liblzma.so
/usr/local/lib/liblzma.so
$
 
wblock@ said:
Simulpost... Yes, it looks like usr/local/lib/liblzma.so should not be there. It's not part of a package.

Agreed, but I think there are a number of such entries in there.
 
wblock@ said:
The script might need /usr/lib added, but I'm not sure if a symlink would be the problem.

I just added that, and ran it again:

Code:
$ ./fastfakelib
reading package contents
checking /usr/local/lib
checking /lib
checking /usr/local/lib/compat/pkg
checking /usr/lib
 
Delete the /usr/local/lib/liblzma.so file and the related soft links. Your ports should build fine after that.
 
kpa said:
Delete the /usr/local/lib/liblzma.so file and the related soft links. Your ports should build fine after that.

FYI, I removed these items from /usr/local/lib:

Code:
liblzma.so
lzcat
lzma
unlzma
unxz
xzcat

Then I deleted libxslt and xmlto, then rebuilt git, which was successful.

FYI, I have another jail with the same problem. I'm about to try fix it too.
 
I think this will work: find -s /usr/local/lib -depth 1 -prune -name "*.so" -exec pkg_info -W {} \; | grep -Hv package.
 
wblock@ said:
I think this will work: find -s /usr/local/lib -depth 1 -prune -name "*.so" -exec pkg_info -W {} \; | grep -Hv package.

Sorry, I'd already fixed both broken jails before I saw this.

I tested the script by creating a file in /usr/local/lib but the script still didn't output anything.
 
Back
Top