Although Linux is popular mainly due to the absence of viruses, it can still exist, especially if you usually download materials from untrusted sources. Since viruses are not a serious problem in Linux, there are no huge number of antiviruses for this operating system. One of the best among them is the ClamAV antivirus, which does its job pretty well.
In this article, we will describe how to install and use the following programs to scan a Debian system for viruses:
- ClamAV-A Command Line Utility: It is a free, open-source, cross-platform antivirus tool for detecting many types of malware and viruses.
- ClamTK-A Graphic Utility: ClamTk is a graphical interface for the Clam antivirus. It is designed as an easy-to-use and lightweight on-demand virus scanner for Linux systems.
We have completed the command and procedures mentioned in this article for the Debian 10 Buster system.
Work with ClamAV
If you prefer a command line utility to remove viruses on your Debian, you can use the ClamAV software through the Terminal application.
Install ClamAV on Debian 10
Follow these steps to install ClamAV on your Debian.
First, open the “Terminal” application through a search in the application launcher as follows:
To install the latest available version of software from online storage, your local storage index must match it. Run the following command as sudo to update the local repository index:
$ sudo apt-get update
Please note that only an authorized user can add / remove and configure software in Debian.
Then run the following command as sudo to install the ClamAV daemon from the APT repositories:
$ sudo apt-get install clamav clamav-daemon
The system may ask you to enter a password for sudo, as well as provide you with the option Y / n to continue the installation. Type Y, then press Enter; ClamAV will be installed on your system. However, the process may take some time depending on the speed of your internet.
You can check your ClamAV installation, as well as check the version number by running the following command in your terminal:
$ clamscan --version
Scan Debian Linux for viruses
The ClamAV utility provides you with many options on the basis of which you can scan files and folders on your system for viruses. You can get detailed information about these options by looking at the ClamAV help as follows:
$ clamscan --help
In this example, I will scan the Images folder of the current user.
$ sudo clamscan --infected --remove --recursive /home/sana/Pictures
It is usually good to run the command as sudo so that all sensitive folders can be scanned without permission problems.
It is assumed that the command recursively scans and deletes all files and folders in the / home / user / Pictures folder.
The output displays a scan summary in the following format:
You can use the following command to scan your entire Debian system:
$ sudo clamscan --infected --remove --recursive /
If you ever want to remove the ClamAV utility from your Debian, you can do this with the following command:
$ sudo apt-get remove clamav clamav-daemon
Enter y when the system prompts you for y / n. The software will be removed from your system.
Work with ClamTK ClamAV GUI
If you prefer to use the Debian GUI to remove viruses on your Debian, you can use the ClamTK software, which is easily available at the Debian Software Center.
Please follow these steps to install ClamTK using Debian Software Manager:
On the Actions toolbar / dock on the Debian desktop (press the Super / Windows key to access it), click the Debian software icon.
Click on the search icon and enter ClamTK in the search bar. Search results will contain relevant entries as follows:
The ClamTK entry, listed here above, is one maintained by the Debian Stable Main repository. Click on this search entry to open the following view:
Click the Install button to start the installation process. The following authentication dialog will appear for you to provide your authentication information.
Please note that only an authorized user can add / remove and configure software in Debian. Enter your password and click the Authentication button. After that, the installation process will begin, displaying a progress bar as follows:
ClamTK will be installed on your system, and after successful installation you will receive the following message:
In the dialog above, you can directly launch ClamTK and even remove it immediately for any reason.
How to scan for viruses
You can start ClamTK through the command line by running the following command:
Or use the Application Launcher search bar to launch the application as follows:
Here’s what the ClamTK utility looks like:
Using this interface you can do the following configuration:
- View and set your settings using the settings icon
- View and update the scan whitelist using the whitelist icon
- Change proxy settings through the network icon
- Schedule scans or signature updates using the scheduler icon
You can drive history, such as the:
- View previous scans using the history icon
- Managing quarantined files using the Quarantine icon
Manage updates, such as:
- Update antivirus signatures using the Refresh icon
- Configure signature update settings using the Update Assistant icon.
Most importantly, you can perform scanning functions, such as:
- File scan
- Directory Scan
- View file reputation with analysis icon
If you want to remove ClamTK, which was installed in the above way, you can remove it from your system as follows:
Open Debian Software Manager and find ClamTK. You will see the “Installed” status in the search bar. Click this entry, and then click Delete from the following view:
The system will offer you an authentication dialog. The software will be removed when you provide the password for the sudo user and click the “Authentication” button in the dialog box.
Thus, these were two ways to use Clam Antivirus; through the command line and through the user interface. You can install and use one or even both depending on your preferences and make sure that your Debian files do not contain malicious content.
Secure Debian with ClamAV Antivirus