Install Libjson-c-dev Ubuntu
Sep 02, 2017 libjson0-dev dependency install-issues #1. Sleepdefic1t opened this issue Sep 2. Sudo apt-get install libjson-c-dev will install the correct frameworks. JSON manipulation library - development files. This library allows you to easily construct JSON objects in C, output them as JSON formatted strings and parse JSON formatted strings back into the C representation of JSON objects. Download libjson-c-dev0.12.1-1.3amd64.deb for 18.04 LTS from Ubuntu Main repository. (very optional) Those wishing to use clamav-milter may wish to install the following sudo apt-get install libmilter1.0.1 libmilter-dev Install the unit testing dependencies. Sudo apt-get install valgrind check check-devel Note: LLVM is also an optional dependency. LLVM will not provide any additional features, but is an alternative method for executing bytecode signatures versus using the built-in bytecode.
Below are the steps for installing ClamAV from source on Debian and Ubuntu Linux.
If you want to use ZMap with Redis, you will first need to install hiredis. Then run cmake with -DWITHREDIS=ON. Debian/Ubuntu has packaged hiredis as libhiredis-dev; Fedora and RHEL/CentOS have packaged it as hiredis-devel. Ttyd - Share your terminal over the web. Ttyd is a simple command-line tool for sharing terminal over the web. Built on top of Libwebsockets with libuv for speed; Fully-featured terminal based on Xterm.js with CJK (Chinese, Japanese, Korean) and IME support; Graphical ZMODEM integration with lrzsz support; SSL support based on OpenSSL; Run any custom command with options.
Download libjson0-dev0.11-4ubuntu2amd64.deb for 16.04 LTS from Ubuntu Main repository.
Install prerequisites
Install ClamAV dependencies
- Install the developer tools
- Install library dependencies
- (very optional) Those wishing to use clamav-milter may wish to install the following
Install the unit testing dependencies
Note: LLVM is also an optional dependency. LLVM will not provide any additional features, but is an alternative method for executing bytecode signatures versus using the built-in bytecode interpreter. Limited performance testing between LLVM and the bytecode interpreter did not yield conclusive evidence that one is 'better' than the other. For the sake of simplicity, it is not recommended to install LLVM.
Download the latest stable release
- Open a browser and navigate to the ClamAV downloads page
- Click
clamav-<version>.tar.gz
link to download the latest stable release.
Extract the source archive
Configure the build
ClamAV's configure script should detect each of the above dependencies automatically.
Typical ./configure
usage
Once ./configure
completes, it will print a summary. Verify that the packages you installed are in fact being detected.
Example configure summary output:
Additional popular ./configure
options
--with-systemdsystemunitdir
- Do not installsystemd
socket files. This option disables systemd support, but will allow you tomake install
to a user-owned directory without requiringsudo
/root privileges:--sysconfdir
- Install the configuration files to/etc
instead of/usr/local/etc
:--prefix
- Install ClamAV to a directory other than/usr/local/
:- Example 1: Install to a local
./install
directory. - Example 2: Install ClamAV locally on an unprivileged shell account.
- Example 1: Install to a local
--disable-clamav
- Don't drop super-user priveleges to runfreshclam
orclamd
as theclamav
* user. *Tip: Using this--disable-clamav
means thatfreshclam
andclamd
will run with root privleges if invoked usingsudo
. Runningclamd
orclamscan
as root is not recommended. Instead of using this option, you can configurefreshclam
orclamd
to drop to any other user by:- setting the
DatabaseOwner
option infreshclam.conf
and - setting the
User
option inclamd.conf
.
- setting the
Please see the ./configure --help
for additional options.
Compile ClamAV
Compile ClamAV with:
Run ClamAV Unit Tests (Optional)
For peace of mind, it can be helpful to run a small suite of unit and system tests.
Run:
All tests should pass.* Output will look something like this:
Notes:
- The
*.vg.sh
tests will be skipped unless you runmake check VG=1
. - The
check7_clamd.hg.sh
(helgrind) is presently disabled and will be skipped.- For details, see: the Git commit
If you have a failure or an error in the unit tests, it could be that you are missing one or more of the prerequisites.
If you are investigating a failure, please do the following:
cd unit_tests
Use less
to read the log for the failed test.Example:
To submit a bug report regarding unit text failures, please follow these bug reporting steps.
Install ClamAV
Install ClamAV with:
Tip: If installing to the default or other system-owned directory, you may need to use sudo
.
First time set-up
Note: The following instructions assume you used the default install paths (i.e. /usr/local
). If you modified the install locations using --prefix
or --sysconfdir
options, replace /usr/local
with your chosen install path.
freshclam
config
Before you can use freshclam
to download updates, you need to create a freshclam
config. A sample config is provided for you.
Copy the sample config. You may need to use
sudo
:Modify the config file using your favourite text editor. Again, you may need to use
sudo
.- At a minimum, remove the
Example
line sofreshclam
can use the config.
Take the time to look through the options. You can enable the sample options by deleting the
#
comment characters.Some popular options to enable include:
LogTime
LogRotate
NotifyClamd
DatabaseOwner
- At a minimum, remove the
Create the database directory. *Tip: You may need to use
sudo
.
clamd
config (optional)
You can run clamscan
without setting the config options for clamd
. However, the clamd
scanning daemon allows you to use clamdscan
to perform faster a-la-carte scans, allows you to run multi-threaded scans, and allows you to use clamav-milter
if you want to use ClamAV as a mail filter if you host an email server.
Additionally, if you are a running modern versions of Linux where the FANOTIFY kernel feature is enabled, clamd
has a feature run with On-Access Scanning*. When properly configured, On-Access Scanning can scan files as they are accessed and optionally block access to the file in the event that a signature alerted.
Note: At this time, for On-Access Scanning to work, clamd
must run with sudo
/root privileges. For more details, please see our documentation on On-Access Scanning.
Copy the sample config. You may need to use
sudo
:Modify the config file using your favourite text editor. Again, you may need to use
sudo
.- At a minimum, remove the
Example
line sofreshclam
can use the config. - You also need to select a Socket option for
clamd
soclamdscan
and other utilities can communicate withclamd
. You must enable one of the following.LocalSocket
TCPSocket
Take the time to look through the options. You can enable the sample options by deleting the
#
comment characters.Some popular options to enable include:
LogTime
LogClean
LogRotate
User
ScanOnAccess
OnAccessIncludePath
OnAccessExcludePath
OnAccessPrevention
- At a minimum, remove the
Configure SELinux for ClamAV
Certain distributions (notably RedHat variants) when operating with SELinux enabled use the non-standard antivirus_can_scan_system
SELinux option instead of clamd_can_scan_system
.
At this time, libclamav only sets the clamd_can_scan_system
option, so you may need to manually enable antivirus_can_scan_system
. If you don't perform this step, freshclam will log something like this when it tests the newly downloaded signature databases:
To allow ClamAV to operate under SELinux, run the following:
Download / Update the signature database
Before you can run a scan, you'll need to download the signature databases. Once again, you may need to run with sudo
/root privileges.
If you installed to a location in your system PATH:
If you installed to another location:
Important: It is common on Ubuntu after a fresh install to see the following error the first time you use ClamAV:
You can fix this error by using ldconfig to rebuild the library search path.
Users and on user privileges
If you are running freshclam
and clamd
as root or with sudo
, and you did not explicitely configure with --disable-clamav
, you will want to ensure that the DatabaseOwner
user specified in freshclam.conf
owns the database directory so it can download signature udpates.
Install Libjson-c-dev Ubuntu Mac
The user that clamd
, clamdscan
, and clamscan
run as may be the same user, but if it isn't -- it merely needs read access to the database directory.
If you choose to use the default clamav
user to run freshclam
and clamd
, you'll need to create the clamav group and the clamav user account the first time you install ClamAV.
Install Libjson-c-dev Ubuntu Download
Finally, you will want to set user ownership of the database directory.For example:
Usage
You should be all set up to run scans.
Take a look at our usage documentation to learn about how to use ClamAV each of the utilities.