How to Easily Run an Antivirus Scan in Ubuntu 20.04 / 22.04 & Debian 11

I never did an antivirus scan in Linux. But, it may be useful if you have files transferred via an email or USB stick. To keep away from malware, Clam AntiVirus (aka ClamAV) is a well-known method to scan for viruses in Linux.

ClamAV & ClamTk:

The ClamAV is a free open-source antimalware toolkit for Unix, Linux, BSD, MacOS and Solaris, though it runs in Microsoft Windows. It’s always the first choice for Linux beginners.

As ClamAV has only a command-line scanner, ClamTk is an free open-source app that provides a lightweight, easy to use graphical interface based on it.

Install ClamAV & ClamTk:

Both packages are available in most Linux repositories. Though, they provide own packages in their website via .deb & .rpm formats.

Step 1: Install ClamAV

As mentioned, user may install the package either from system’s own repository or from software website. Though, I recommend the former because it’s well packaged for your system and available in all CPU architectures (amd64, arm64, s390x, etc)

Firstly, open terminal from start menu (“Activities” overview). Then, run command:

sudo apt install clamav
You may skip this step, as installing ClamTk in "Step 2" will install it automatically as dependency.

Alternatively, download & install the latest package from ClamAV website:

Select the .deb for Debian/Ubuntu based systems, and .rpm for Fedora/CentOS. However, the package from ClamAV website does not scan in my case in Ubuntu 20.04!! So I recommend the apt command

Step 2: Install ClamTk

Also, ClamTk in Linux own repositories available to install in amd64, arm64, etc architectures.

Simply open terminal from start menu (searching from ‘Activities‘ overview) and run command to install it:

sudo apt install clamtk
Install ClamTk as well as ClamAV as dependencies in Debian/Ubuntu

For choice, user may download & double-click install the latest ‘.deb‘ package from the Github releases page:

Scan Your USB or other Files/Folders via ClamAV & ClamTk:

For those running on Ubuntu or Debian Server without a desktop environment. Run the commands below to scan your files:

  • Update the database via command:
    sudo freshclam
  • Scan for viruses:
    clamscan /PATH/TO/FILE_or_FOLDER

For desktop users, search for and open ‘ClamTk’ from Activities overview screen.

When the apps opens, you’ll see the options to scan files or folders, as well as settings for whitelist, scheduler and more.

The ClamTk UI

Before start scanning anything, you may need to click “settings” and enable some options as you mind.

  • Enable “Scan directories recursively” if you want to scan folders.
  • Move the cursor over other options, it will indicate what does it do.

Finally, click on “Scan a file” or “Scan a directory” on main UI and select scan your files/folders.

Uninstall ClamTk & ClamAV:

As mentioned, the official ClamAV package may not work properly. In my case, it’s missing few config file and ClamTk always says scanned 0.

Anyhow, it can be easily removed by running command in terminal:

sudo apt remove --autoremove clamav

It will also remove clamtk and other useless dependency packages too.

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.