4

After installing Ubuntu 18.04 some weeks ago, I tried to install clamav, that I was effectively using in my previous Kubuntu 14.10 system. The first step of clamav installation went well, but when I tried to download the signature database main.cvd with the freshclam command I wasn't able to proceed further. I always get the error message "!Can't download main.cvd from db.it.clamav.net" EXACTLY when the download process arrives at 86%. I tried to change the mirror downloading site (.it, .fr) and to increase the timeout from 30 to 120, and also to re-run the command in several different days, but with no results. Here is the series of messages I got from the Terminal:

fla-user@FLA-DESKTOP:~$ sudo freshclam -v
Thu Sep 27 20:58:18 2018 -> *Current working dir is /var/lib/clamav
Thu Sep 27 20:58:18 2018 -> *Max retries == 2
Thu Sep 27 20:58:18 2018 -> ClamAV update process started at Thu Sep 27 20:58:18 2018
Thu Sep 27 20:58:18 2018 -> *Using IPv6 aware code
Thu Sep 27 20:58:18 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 20:58:18 2018 -> *TTL: 702
Thu Sep 27 20:58:18 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 20:58:18 2018 -> *Retrieving http://db.it.clamav.net/main.cvd
Thu Sep 27 20:58:18 2018 -> *Trying to download http://db.it.clamav.net/main.cvd (IP: 104.16.189.138)
Thu Sep 27 21:01:44 2018 -> ^getfile: Download interrupted: Connection reset by peer (IP: 104.16.189.138)
Thu Sep 27 21:01:44 2018 -> ^Can't download main.cvd from db.it.clamav.net
Thu Sep 27 21:01:44 2018 -> *Querying main.0.92.0.0.6810BD8A.ping.clamav.net
Thu Sep 27 21:01:44 2018 -> *Can't query main.0.92.0.0.6810BD8A.ping.clamav.net
Thu Sep 27 21:01:44 2018 -> Trying again in 5 secs...
Thu Sep 27 21:01:49 2018 -> ClamAV update process started at Thu Sep 27 21:01:49 2018
Thu Sep 27 21:01:49 2018 -> *Using IPv6 aware code
Thu Sep 27 21:01:49 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 21:01:49 2018 -> *TTL: 877
Thu Sep 27 21:01:49 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 21:01:49 2018 -> *Retrieving http://db.it.clamav.net/main.cvd
Thu Sep 27 21:01:49 2018 -> *Trying to download http://db.it.clamav.net/main.cvd (IP: 104.16.187.138)
Thu Sep 27 21:05:27 2018 -> !getfile: Download interrupted: Connection reset by peer (IP: 104.16.187.138)
Thu Sep 27 21:05:27 2018 -> !Can't download main.cvd from db.it.clamav.net
Thu Sep 27 21:05:27 2018 -> *Querying main.0.92.0.0.6810BB8A.ping.clamav.net
Thu Sep 27 21:05:27 2018 -> *Can't query main.0.92.0.0.6810BB8A.ping.clamav.net
Thu Sep 27 21:05:27 2018 -> Giving up on db.it.clamav.net...
Thu Sep 27 21:05:27 2018 -> ClamAV update process started at Thu Sep 27 21:05:27 2018
Thu Sep 27 21:05:27 2018 -> *Using IPv6 aware code
Thu Sep 27 21:05:27 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 21:05:27 2018 -> *TTL: 659
Thu Sep 27 21:05:27 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 21:05:27 2018 -> *Retrieving http://database.clamav.net/main.cvd
Thu Sep 27 21:05:27 2018 -> *Trying to download http://database.clamav.net/main.cvd (IP: 104.16.186.138)
Thu Sep 27 21:08:54 2018 -> !getfile: Download interrupted: Connection reset by peer (IP: 104.16.186.138)
Thu Sep 27 21:08:54 2018 -> !Can't download main.cvd from database.clamav.net
Thu Sep 27 21:08:54 2018 -> *Querying main.0.92.0.0.6810BA8A.ping.clamav.net
Thu Sep 27 21:08:54 2018 -> *Can't query main.0.92.0.0.6810BA8A.ping.clamav.net
Thu Sep 27 21:08:54 2018 -> Giving up on database.clamav.net...
Thu Sep 27 21:08:54 2018 -> Update failed. Your network may be down or none of the mirrors listed in /etc/clamav/freshclam.conf is working. Check https://www.clamav.net/documents/official-mirror-faq for possible reasons.

Can anyone help me to solve the problem? Thanks in advance.

Flavio

guiverc
  • 30,396

6 Answers6

9

I ran into a similar issue: the clamav-freshclam service was filling up /var/log/clamav/freshclam.log with these timeout failures and when I shut down that service and did a manual run of freshclam, it would get partway through and then fail out. I found that in the config file /etc/clamav/freshclam.conf there are two timeout directives, one named ConnectTimeout and the other named RecieveTimeout, both of which were set to 30 by default. I changed the ConnectTimeout to 10 (no reason to wait more than 10 seconds for a connection) and set the Receive timeout to 120 (needed way more time to pull down definition files over my anemic DSL connection) and now both freshclam and the clamav-freshclam service are both able to update properly.

1

Removing any junk sources that you may have and installing ClamAv by the right way it may solve the problem.

1. Press: Ctrl+Alt+T

2. Type in terminal:sudo gedit /etc/apt/sources.list

3. Remove any junk sources you may have, look to the bottom and be careful look twice then remove, save.

4. In terminal:

sudo apt-get update
sudo apt-get install --reinstall clamav
sudo rm -r /var/log/clamav/freshclam.log
sudo /etc/init.d/clamav-freshclam start
sudo freshclam
  • Thanks. I tried your suggested command "sudo gedit /etc/apt/sources.list.save". Since I am not a very experienced Linux user, can you please explain me how I can do what you call "Remove any junk sources"? Flavio – Flavio P. Oct 01 '18 at 15:07
  • @Flavio P i edited my answer edit the sources by typing: sudo gedit /etc/apt/sources.list BUT if you did't add any sources to repository list, simply avoid this command continue to step 4. Never mess with the sources if you don't know, but if you wish to find more about it: https://linux.die.net/man/5/sources.list – GoldHaloWings Oct 02 '18 at 22:09
  • GoldHaloWings, I better understood your point on sources; I disabled every other source except the "official" Canonical. Then I executed the sequence of commands you suggested; all the installation process for clamav and the associated applications went on correctly. Also the freshclam process started normally; the download of main.cvd gradually moved on from 1% up to exacltly 86% (always the same number!) and then stopped.Then timeout, repetition of the process and the same result. I also tried to disable apparmor and ufw, but I got again the same "86%" result. I will further investigate... – Flavio P. Oct 08 '18 at 14:08
0

After a couple of weeks where I did not make any further attempt to solve my freshclam download problem, unexpectedly but positively I found that the signatures file main.cvd had been fully downloaded automatically in background. So now I can normally use both the clamscan command and the GUI ClamTK application.

I don't know what the problem was (probably something related to a communication server) nor how and when it was overcome, but now everything is all right.

0

Do take note of the size of the file that you're downloading - in my case, I only had 82MB of disk space available, but the file I was about to download was 112MB. I always use an LVM (Ubuntu) and so was able to successfully extend the volume group and then sudo freshclam worked flawlessly

bnoeafk
  • 133
0

The problem for me seems that the download is too big. It was trying to download 103.95 MB and could only get 86 MB before it would time out, every time after 30 seconds.

I am running an i7, 16 GB with 256 SSD so I don't think it is my machine's fault. It probably has to do with how many signatures they load into the download file.

Greenonline
  • 2,081
MartyK
  • 1
0

You should change the freshclam configuration by editing the /etc/clamav/freshclam.conf file:

vi /etc/clamav/freshclam.conf

and changing

ConnectTimeout 10

and

ReceiveTimeout 200        # (or more)