{"id":9134,"date":"2024-04-05T15:29:14","date_gmt":"2024-04-05T15:29:14","guid":{"rendered":"https:\/\/www.linuxandotherstuff.com\/?p=9134"},"modified":"2024-04-05T15:29:14","modified_gmt":"2024-04-05T15:29:14","slug":"how-to-install-clamav-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2024\/04\/05\/how-to-install-clamav-on-ubuntu\/","title":{"rendered":"How to Install ClamAV on Ubuntu"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>How to Install ClamAV on Ubuntu<\/strong><\/h2>\n\n\n\n<p>You can install ClamAV on Linux Ubuntu by following the steps below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Update the Package Repository Index&nbsp;<\/strong><\/h3>\n\n\n\n<p>To update the package repository index, you can execute the following command.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get update\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Install ClamAV<\/strong><\/h3>\n\n\n\n<p>To install the ClamAV, you can execute the following command.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo apt-get install clamav clamav-daemon -y\n<\/pre><\/div>\n\n\n<p>Here is the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nroot@noufal:~# sudo apt-get install clamav clamav-daemon -y\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nThe following additional packages will be installed:\n  clamav-base clamav-freshclam clamdscan libclamav9 libltdl7 libtfm1\nSuggested packages:\n  libclamunrar clamav-docs daemon libclamunrar9\nThe following NEW packages will be installed:\n  clamav clamav-base clamav-daemon clamav-freshclam clamdscan libclamav9 libltdl7 libtfm1\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 3: Confirm the ClamAV Version<\/strong><\/h3>\n\n\n\n<p>After installing ClamAV, execute the following command to confirm the ClamAV version.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nroot@noufal:~# clamscan --version\nClamAV 0.103.8\/26825\/Mon Feb 27 08:24:38 2023\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 4: Update the ClamAV Signature Database<\/strong><\/h3>\n\n\n\n<p>ClamAV detects malware using virus signature databases. The most recent signatures are regularly updated in these databases. To keep protected, you must also download and install these updates on your ClamAV installation.<\/p>\n\n\n\n<p>To update the ClamAV Signature Database, follow these steps.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Stop the ClamAV Service<\/strong><\/h4>\n\n\n\n<p>You will need to execute the following command to stop the ClamAV service.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl stop clamav-freshclam\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Manually Update the ClamAV Signature Database<\/strong><\/h4>\n\n\n\n<p>You must execute the following command to update the ClamAV signature database manually.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo freshclam\n<\/pre><\/div>\n\n\n<p>Here is the output.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nroot@noufal:~# sudo freshclam\nThu Mar 2 06:10:22 2023 -&gt; ClamAV update process started at Tue Mar 2 06:10:22 2023\nThu Mar 2 06:10:22 2023 -&gt; daily.cvd database is up-to-date (version: 26825, sigs: 2021909, f-level: 90, builder: raynman)\nThu Mar 2 06:10:22 2023 -&gt; main.cvd database is up-to-date (version: 62, sigs: 6647427, f-level: 90, builder: sigmgr)\nThu Mar 2 06:10:22 2023 -&gt; bytecode.cvd database is up-to-date (version: 334, sigs: 91, f-level: 90, builder: anvilleg)\n\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\"><strong>Start the ClamAV Service<\/strong><\/h4>\n\n\n\n<p>You will need to execute the following command to start the ClamAV service.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo systemctl start clamav-freshclam\n<\/pre><\/div>\n\n\n<p>You can list the options available with ClamAV by executing the following command.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nman clamscan\n<\/pre><\/div>\n\n\n<p>To scan a directory recursively, execute the command below.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclamscan --infected --remove --recursive foldername\n<\/pre><\/div>\n\n\n<p>To scan a file, execute the command below.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nclamscan --remove filename\n<\/pre><\/div>\n\n\n<p>Here are explanations of some portions of the commands.<\/p>\n\n\n\n<p><strong><em>-i, &#8211;infected<\/em><\/strong>: Only show infected files on the screen. Clean files are not displayed. To suppress, use this option.<\/p>\n\n\n\n<p><strong><em>-r, &#8211;recursive<\/em><\/strong>: Scan the folder and its subfolders recursively. Avoid using this setting to restrict the scan to the top folder.<\/p>\n\n\n\n<p><strong><em>&#8211;remove<\/em><\/strong>: Remove infected files automatically. If a false-positive detection occurs when using this option, ClamAV will also delete those files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install ClamAV on Ubuntu You can install ClamAV on Linux Ubuntu by following the steps below. Step 1: Update the Package Repository Index&nbsp; To update the package repository index, you can execute the following command. Step 2: Install ClamAV To install the ClamAV, you can execute the following command. Here is the output. &#8230; <a title=\"How to Install ClamAV on Ubuntu\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2024\/04\/05\/how-to-install-clamav-on-ubuntu\/\" aria-label=\"Read more about How to Install ClamAV on Ubuntu\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[],"class_list":["post-9134","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/9134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=9134"}],"version-history":[{"count":1,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/9134\/revisions"}],"predecessor-version":[{"id":9135,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/9134\/revisions\/9135"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=9134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=9134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=9134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}