Project

General

Profile

How to install ClamAV » History » Version 2

Gareth Eaton, 07/23/2023 11:51 AM

1 1 Gareth Eaton
h1. How to install ClamAV
2
3
Installing ClamAV on Ubuntu:
4
5
Step 1: Update Package List
6
7
8
<pre>
9
sudo apt update
10
</pre>
11
12
Step 2: Install ClamAV
13
14
15
<pre>
16
sudo apt install clamav
17
</pre>
18
19
Step 3: Install ClamAV Daemon (freshclam)
20
21
22
<pre>
23
sudo apt install clamav-daemon
24
</pre>
25
26
27 2 Gareth Eaton
Step 4: Start ClamAV Daemon (freshclam)
28 1 Gareth Eaton
29
30
<pre>
31
sudo systemctl start clamav-freshclam
32
sudo systemctl enable clamav-freshclam
33
</pre>
34
35 2 Gareth Eaton
Step 5: Start ClamAV Service (clamd)
36 1 Gareth Eaton
37
38
<pre>
39
sudo systemctl start clamav-daemon
40
sudo systemctl enable clamav-daemon
41 2 Gareth Eaton
</pre>
42
43
---
44
45
1. Check if freshclam is already running:
46
47
48
<pre>
49
ps aux | grep freshclam
50
</pre>
51
52
If a freshclam process is already running, you'll see an output similar to this. Ensure that freshclam is running as expected and updating the ClamAV database regularly.
53
54
$ ps aux | grep freshclam
55
clamav    12345  3.0  0.0 134420 18216 ?        Ss   09:30   0:03 /usr/bin/freshclam -d --foreground=true
56
user      54321  0.0  0.0  22856  1100 pts/0    S+   10:15   0:00 grep --color=auto freshclam
57
58
59
If there is no freshclam process running, you can proceed with updating the ClamAV database:
60
61
<pre>
62
sudo freshclam
63
</pre>
64
65
---
66
67
Reconfigure clamav-freshclam:
68
69
Run the following command to reconfigure clamav-freshclam, which will create a new freshclam.conf file in the /etc/clamav/ folder:
70
71
<pre>
72
sudo dpkg-reconfigure clamav-freshclam
73 1 Gareth Eaton
</pre>