Solved Rsync problem - shared object "libiconv.so.2" not found, required by "rsync"

Greetings all,

this is an error upon trying to use rsync installed from package.

But: pkg which /usr/local//lib/libiconv.so.2
Code:
/usr/local/lib/libiconv.so.2 was installed by package libiconv-1.16

Why was it not fount then?

Kindest regards,

M
 
FreeBSD ? 12 ? 13 ?

amd64, arm64, i386?

Everything installed by packages only? Or mixed with ports? If so, how?

Tried re-installing packages?

Any other changes? Upgrades done?

Anything showing in ldd?
Code:
% ldd /usr/local/bin/rsync
/usr/local/bin/rsync:
    liblz4.so.1 => /usr/local/lib/liblz4.so.1 (0x8002c5000)
    libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x8002f3000)
    libxxhash.so.0 => /usr/local/lib/libxxhash.so.0 (0x8003e9000)
    libcrypto.so.11 => /usr/local/lib/libcrypto.so.11 (0x8003f6000)
    libc.so.7 => /lib/libc.so.7 (0x80067d000)
    libthr.so.3 => /lib/libthr.so.3 (0x800a73000)
I build rsync from ports, and didn't select ICONV so it's not showing in my output - but maybe some clues in your output.

Have you mangled PATH? What does echo $PATH show if anything?
 
Hi richardtoohey2,

thank you for the reply.

Fresh install of FreeBSD 12.2, amd64, from bootonly, so everything was pulled form the online repository. rsync is the first package installed, tried to reinstall package, no change.

Code:
% ldd /usr/local/bin/rsync
/usr/local/bin/rsync:
    liblz.so.6 => /lib/liblz.so.6 (0x8002b7000)
    libiconv.so.2 => not found (0)
    liblz4.so.1 => not found (0)
    libzstd.so.1 => not found (0)
    libxxhash.so.0 => not found (0)
    libcrypto.so.111 => /lib/libcrypto.so.111 (0x8002d3000)
    libc.so.7 => /lib/libc.so.7 (0x8005c5000)
    libthr.so.3 => /lib/libthr.so.3 (0x8009bb000)

Did not do anything about PATH. echo $PATH
Code:
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

Kindest regards,

M
 
Code:
 $ ldd `which rsync`                                                                         
/usr/local/bin/rsync:
    libz.so.6 => /lib/libz.so.6 (0x8002b7000)
    libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x8002d3000)
    liblz4.so.1 => /usr/local/lib/liblz4.so.1 (0x8003d3000)
    libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x800401000)
    libxxhash.so.0 => /usr/local/lib/libxxhash.so.0 (0x8004ee000)
    libcrypto.so.111 => /lib/libcrypto.so.111 (0x8004fb000)
    libc.so.7 => /lib/libc.so.7 (0x8007ed000)
    libthr.so.3 => /lib/libthr.so.3 (0x800be3000)
 $ pkg info rsync                                                                            
rsync-3.2.3
Name           : rsync
Version        : 3.2.3
Installed on   : Sun Feb 14 08:14:42 2021 PST
Origin         : net/rsync
Architecture   : FreeBSD:12:amd64
Prefix         : /usr/local
Categories     : net
Licenses       : GPLv3+
Maintainer     : rodrigo@FreeBSD.org
WWW            : http://rsync.samba.org/
Comment        : Network file distribution/synchronization utility
Options        :
    DOCS           : on
    FLAGS          : on
    ICONV          : on
    POPT_PORT      : off
    RENAMED        : off
    SSH            : on
    ZLIB_BASE      : on
Shared Libs required:
    libxxhash.so.0
    liblz4.so.1
    libiconv.so.2
    libzstd.so.1
Annotations    :
    FreeBSD_version: 1202000
    cpe            : cpe:2.3:a:samba:rsync:3.2.3:::::freebsd12:x64
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 789KiB
Description    :
rsync is a replacement for rcp that has many more features.
...
Try pkg install -f rsync
 
Hi Jose,

thank you, reinstalling (for the 3rd time) helped - temporarily. I issued the command with -vn options to ascertain how it will work, and it did list the files to be synchronized.

However, when I removed the -n to run it, it rewarded me again with the same error:
Code:
shared object "libiconv.so.2" not found, required by "rsync"

What the heck is wrong?

Kindest regards,

M
 
Problem doesn't seem to be the installation of rsync but of libiconv. Force a reinstall of that: pkg install -f libiconv.
 
thank you, reinstalling (for the 3rd time) helped - temporarily. I issued the command with -vn options to ascertain how it will work, and it did list the files to be synchronized.

However, when I removed the -n to run it, it rewarded me again with the same error:
Code:
shared object "libiconv.so.2" not found, required by "rsync"
The -n option makes it so pkg-install(8) reports what it would do, but doesn't actually perform any actions. All you've confirmed is that pkg itself works.

You are missing a lot of libraries that should be installed as Richardtoohey2 points out. Your system appears to be quite FUBAR. Did rsync ever work? Have you messed around with your disks and partitions? Have you perhaps mounted a new filesystem under /usr/local?
 
The missing libraries are all in /usr/local/lib, and they are also the only libraries in /usr/local/lib required by rsync.

It looks to me like the runtime link-editor might be blind to /usr/local/lib. Have you had a close look at that directory (all path components should be mode 755 root:wheel).

Is there anything in your environment steering the runtime link-editor:
Code:
[f12.144] $ set | grep LD
Are there any other problems with other ELF executables in /usr/local/bin, e.g.
Code:
[f12.138] $ ldd /usr/local/bin/bash
/usr/local/bin/bash:
    libreadline.so.8 => /usr/local/lib/libreadline.so.8 (0x80032e000)
    libhistory.so.8 => /usr/local/lib/libhistory.so.8 (0x800386000)
    libncurses.so.8 => /lib/libncurses.so.8 (0x800393000)
    libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8003ec000)
    libdl.so.1 => /usr/lib/libdl.so.1 (0x8003fb000)
    libc.so.7 => /lib/libc.so.7 (0x8003ff000)
    libncursesw.so.8 => /lib/libncursesw.so.8 (0x8007f5000)
 
Greetings all,

thank you all for the helpful advices.

As I noted, this was a fresh installation without any changes. net/rsync was the first package installed, including three more packages installed with it, but did not run with the noted errors re library/ies. Re-installation with the -f option as advised by Jose, and attempting to execute net/rsync with -nv option to ascertain whether the re-installation worked showed the expected files to be synchronized. Subsequent execution with removed -n option resulted again in the noted errors re library/ies.

Rebooting the system, a well honed practice from Windows administration, resulted in working net/rsync. However, since I have serious misgivings regarding such a "solution", I will re-install.

Kindest regards,

M
 
Hi richardtoohey2,

please do not spent any time on the issue. First, the reboot appears to have cured the problem since I had been able to repeatedly run net/rsync just to ensure that the issue had been solved; second, I will re-install anyway because, perhaps, there is another problem that has not manifested itself yet.

Kindest regards,

M
 
Back
Top