Thu Jun 17 13:57:34 EEST 2010

How to solve: "LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable" error

Whilst installing clamav 0.96.1 stable from source I came across the error LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable
I then realized my clamav is compiled without unrar support in it:
So afterwards I had to recompile clamav after installing:

debian-server:~# apt-get install unrar-free
debian-server:~# apt-get install libncurses5-dev
debian-server:~# apt-get install libbz2-dev


Above libncurses5-dev and libbz2-dev doesn't have a direct relation to the missing unrar compiled in clamav, however when I was debugging, if unrar is installed I have realized support for ncurses and bzip2 was disabled in the newly clamav built from the source.
Therefore I decided to install this two as well and recompile to have the aforementioned two included in my clamav antivirus binaries.

But guess what this doesn't at all solved the LibClamAV Warning: Cannot dlopen: file not found - unrar support unavailable and the error reoccured during freshclam's initialization with /etc/init.d/freshclam .
To finallysolve that warning and properly start up clamav it was necessary to:
link /usr/local/lib/libclamunrar_iface.so.6 to /usr/lib and right after that to execute ldconfig

debian-server:~# ln -sf /usr/local/lib/libclamunrar_iface.so.6 /usr/lib/
debian-server:~# ldconfig


And Voila!
debian-server:~# /etc/init.d/freshclam stop
debian-server:~# /etc/init.d/freshclam start
Starting freshclam daemon ... done.
!
Warning Solved!
In solving the riddle The following bug report and suggestion to solve the warning helped me a bit
So if my way doesn't works for you you might considering checking it out.