if yum install clamav with transparent proxy(gateway), then you must setting timeout values more than default,advoid timeout .

如果 CentOS 是指定透明代理為網關連線到網際網路,那在使用 yum 安裝套件時,有可能會遇到下面類似的問題。此時只要修改 yum 設定檔,將連線逾時的設定改為寬鬆一點、認定逾時的時間長一點,就能防止問題產生。

[root@localhost ~]# yum install clamav
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.nsysu.edu.tw
 * epel: mirror.unej.ac.id
 * extras: ftp.nsysu.edu.tw
 * updates: ftp.nsysu.edu.tw
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package clamav.x86_64 0:0.97.6-1.el6 will be installed
--> Processing Dependency: clamav-db = 0.97.6-1.el6 for package: clamav-0.97.6-1.el6.x86_64
--> Running transaction check
---> Package clamav-db.x86_64 0:0.97.6-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                    Arch                    Version                          Repository             Size
 clamav                     x86_64                  0.97.6-1.el6                     epel                   10 M
Installing for dependencies:
 clamav-db                  x86_64                  0.97.6-1.el6                     epel                   35 M

Transaction Summary
Install       2 Package(s)

Total size: 46 M
Total download size: 35 M
Installed size: 51 M
Is this ok [y/N]: y
Downloading Packages:
http://mirror.unej.ac.id/pub/fedora-epel/6/x86_64/clamav-db-0.97.6-1.el6.x86_64.rpm: [Errno 12] Timeout on http://mirror.unej.ac.id/pub/fedora-epel/6/x86_64/clamav-db-0.97.6-1.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
http://mirror-fpt-telecom.fpt.net/fedora/epel/6/x86_64/clamav-db-0.97.6-1.el6.x86_64.rpm: [Errno 12] Timeout on http://mirror-fpt-telecom.fpt.net/fedora/epel/6/x86_64/clamav-db-0.97.6-1.el6.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.

edit /etc/yum.conf


# N is timeout seconds limit, default is 30s. can find this option description with [ man yum.conf] command.

squid setting transparent proxy for every version

If you don’t want to modify the browser for using a proxy there is a method that is called “Transparent Proxy“; to use this you need to do like this:

Prior to Squid Version 2.6:

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

Squid Version 2.6 to 3.0:

http_port 3128 transparent

Squid Version 3.1+ :

http_port 3128 intercept

Thanks for taking the time to read this guide, I hope it’s helpful.