Issue:
After installing clamav on a server, it was showing up the error ”/usr/sbin/clamd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory” while running clamscan.
Fix:
Find the path of libiconv.so
whereis libiconv.so
libiconv: /usr/local/lib/libiconv.so /usr/local/lib/libiconv.la
Then to check for the shared library dependencies of exim & clamd,
ldd /usr/sbin/exim & ldd /usr/sbin/clamd where I noticed that the library path ”/usr/local/lib” was not included.
For rectifying this,include the path /usr/local/lib in ld.so.conf, then run ldconfig which should create/refresh links to the shared libraries mentioned in ld.so.conf
And also add the following entry
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib in the exim startup file (this is not needed though , if the previous step works)
This should fix it!