在CentOS 6.X版中安裝防毒軟體ClamAV

 在CentOS 6.X版中安裝防毒軟體ClamAV


1.首先先安裝EPEL Extra Packages for Enterprise Linux repository configuration

[root@localhost ~]#rpm -Uhv http://mirror01.idc.hinet.net/EPEL/6/i386/epel-release-6-8.noarch.rpm

取回中 http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
警告:/var/tmp/rpm-tmp.2PHq0r: 表頭 V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
正在準備…             ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]


3.進行套件更新

[root@localhost ~]# yum -y update

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink                                            | 4.2 kB     00:00    
 * base: mirror01.idc.hinet.net
 * epel: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * updates: centosc6.centos.org
epel                                                     | 4.4 kB     00:00    
epel/primary_db                                          | 6.0 MB     00:00    
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package clamav.x86_64 0:0.98-2.el6.rf will be updated
---> Package clamav.x86_64 0:0.98.1-1.el6 will be an update
--> Processing Dependency: clamav-db = 0.98.1-1.el6 for package: clamav-0.98.1-1.el6.x86_64
---> Package clamd.x86_64 0:0.98-2.el6.rf will be updated
---> Package clamd.x86_64 0:0.98.1-1.el6 will be an update
---> Package ibus-table-cangjie.noarch 0:1.2.0.20100210-1.el6 will be obsoleted
---> Package ibus-table-chinese-cangjie.noarch 0:1.4.6-1.el6 will be obsoleting
--> Processing Dependency: ibus-table-chinese = 1.4.6-1.el6 for package: ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
---> Package ibus-table-chinese-erbi.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-scj.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-wubi-haifeng.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-wubi-jidian.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-erbi.noarch 0:1.2.0.20090901-8.el6 will be obsoleted
---> Package ibus-table-wubi.noarch 0:1.2.0.20090715-8.el6 will be obsoleted
--> Running transaction check
---> Package clamav.x86_64 0:0.98.1-1.el6 will be an update
--> Processing Dependency: clamav-db = 0.98.1-1.el6 for package: clamav-0.98.1-1.el6.x86_64
---> Package ibus-table-chinese.noarch 0:1.4.6-1.el6 will be installed
--> Finished Dependency Resolution
Error: Package: clamav-0.98.1-1.el6.x86_64 (epel)
           Requires: clamav-db = 0.98.1-1.el6
           Installed: clamav-db-0.98.1-1.el6.rf.x86_64 (installed)
               clamav-db = 0.98.1-1.el6.rf
           Available: clamav-db-0.98.1-1.el6.x86_64 (epel)
               clamav-db = 0.98.1-1.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest



3.下載安裝 RPMforge
 [root@localhost ~]# rpm -Uhv http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
取回中 http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
警告:/var/tmp/rpm-tmp.2PHq0r: 表頭 V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
正在準備…             ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]


4.更新套件
[root@localhost ~]# yum -y update
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * epel: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * rpmforge: ftp.kddilabs.jp
 * updates: centosc6.centos.org
rpmforge                                                 | 1.9 kB     00:00    
rpmforge/primary_db                                      | 2.7 MB     00:22    
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package clamav.x86_64 0:0.98-2.el6.rf will be updated
---> Package clamav.x86_64 0:0.98.1-1.el6.rf will be an update
---> Package clamd.x86_64 0:0.98-2.el6.rf will be updated
---> Package clamd.x86_64 0:0.98.1-1.el6.rf will be an update
---> Package ibus-table-cangjie.noarch 0:1.2.0.20100210-1.el6 will be obsoleted
---> Package ibus-table-chinese-cangjie.noarch 0:1.4.6-1.el6 will be obsoleting
--> Processing Dependency: ibus-table-chinese = 1.4.6-1.el6 for package: ibus-table-chinese-cangjie-1.4.6-1.el6.noarch
---> Package ibus-table-chinese-erbi.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-scj.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-wubi-haifeng.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-chinese-wubi-jidian.noarch 0:1.4.6-1.el6 will be obsoleting
---> Package ibus-table-erbi.noarch 0:1.2.0.20090901-8.el6 will be obsoleted
---> Package ibus-table-wubi.noarch 0:1.2.0.20090715-8.el6 will be obsoleted
--> Running transaction check
---> Package ibus-table-chinese.noarch 0:1.4.6-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                           Arch     Version            Repository  Size
================================================================================
Installing:
 ibus-table-chinese-cangjie        noarch   1.4.6-1.el6        epel       3.7 M
     replacing  ibus-table-cangjie.noarch 1.2.0.20100210-1.el6
 ibus-table-chinese-erbi           noarch   1.4.6-1.el6        epel       4.2 M
     replacing  ibus-table-erbi.noarch 1.2.0.20090901-8.el6
 ibus-table-chinese-scj            noarch   1.4.6-1.el6        epel       1.7 M
     replacing  ibus-table-cangjie.noarch 1.2.0.20100210-1.el6
 ibus-table-chinese-wubi-haifeng   noarch   1.4.6-1.el6        epel       4.3 M
     replacing  ibus-table-wubi.noarch 1.2.0.20090715-8.el6
 ibus-table-chinese-wubi-jidian    noarch   1.4.6-1.el6        epel       4.1 M
     replacing  ibus-table-wubi.noarch 1.2.0.20090715-8.el6
Updating:
 clamav                            x86_64   0.98.1-1.el6.rf    rpmforge   2.3 M
 clamd                             x86_64   0.98.1-1.el6.rf    rpmforge   147 k
Installing for dependencies:
 ibus-table-chinese                noarch   1.4.6-1.el6        epel        21 k

Transaction Summary
================================================================================
Install       6 Package(s)
Upgrade       2 Package(s)

Total download size: 21 M
Downloading Packages:
(1/8): clamav-0.98.1-1.el6.rf.x86_64.rpm                 | 2.3 MB     00:26    
(2/8): clamd-0.98.1-1.el6.rf.x86_64.rpm                  | 147 kB     00:01    
(3/8): ibus-table-chinese-1.4.6-1.el6.noarch.rpm         |  21 kB     00:00    
(4/8): ibus-table-chinese-cangjie-1.4.6-1.el6.noarch.rpm | 3.7 MB     00:00    
(5/8): ibus-table-chinese-erbi-1.4.6-1.el6.noarch.rpm    | 4.2 MB     00:00    
(6/8): ibus-table-chinese-scj-1.4.6-1.el6.noarch.rpm     | 1.7 MB     00:00    
(7/8): ibus-table-chinese-wubi-haifeng-1.4.6-1.el6.noarc | 4.3 MB     00:00    
(8/8): ibus-table-chinese-wubi-jidian-1.4.6-1.el6.noarch | 4.1 MB     00:00    
--------------------------------------------------------------------------------
Total                                           481 kB/s |  21 MB     00:43    
警告:rpmts_HdrFromFdno: 表頭 V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
 Userid : EPEL (6) <epel@fedoraproject.org>
 Package: epel-release-6-8.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : ibus-table-chinese-1.4.6-1.el6.noarch                       1/13
  Updating   : clamav-0.98.1-1.el6.rf.x86_64                               2/13
  Updating   : clamd-0.98.1-1.el6.rf.x86_64                                3/13
  Installing : ibus-table-chinese-cangjie-1.4.6-1.el6.noarch               4/13
  Installing : ibus-table-chinese-erbi-1.4.6-1.el6.noarch                  5/13
  Installing : ibus-table-chinese-wubi-jidian-1.4.6-1.el6.noarch           6/13
  Installing : ibus-table-chinese-scj-1.4.6-1.el6.noarch                   7/13
  Installing : ibus-table-chinese-wubi-haifeng-1.4.6-1.el6.noarch          8/13
  Erasing    : ibus-table-wubi-1.2.0.20090715-8.el6.noarch                 9/13
  Erasing    : ibus-table-erbi-1.2.0.20090901-8.el6.noarch                10/13
  Erasing    : ibus-table-cangjie-1.2.0.20100210-1.el6.noarch             11/13
  Cleanup    : clamd-0.98-2.el6.rf.x86_64                                 12/13
  Cleanup    : clamav-0.98-2.el6.rf.x86_64                                13/13
  Verifying  : ibus-table-chinese-1.4.6-1.el6.noarch                       1/13
  Verifying  : ibus-table-chinese-cangjie-1.4.6-1.el6.noarch               2/13
  Verifying  : ibus-table-chinese-erbi-1.4.6-1.el6.noarch                  3/13
  Verifying  : clamd-0.98.1-1.el6.rf.x86_64                                4/13
  Verifying  : ibus-table-chinese-wubi-jidian-1.4.6-1.el6.noarch           5/13
  Verifying  : ibus-table-chinese-scj-1.4.6-1.el6.noarch                   6/13
  Verifying  : ibus-table-chinese-wubi-haifeng-1.4.6-1.el6.noarch          7/13
  Verifying  : clamav-0.98.1-1.el6.rf.x86_64                               8/13
  Verifying  : clamav-0.98-2.el6.rf.x86_64                                 9/13
  Verifying  : ibus-table-wubi-1.2.0.20090715-8.el6.noarch                10/13
  Verifying  : ibus-table-cangjie-1.2.0.20100210-1.el6.noarch             11/13
  Verifying  : clamd-0.98-2.el6.rf.x86_64                                 12/13
  Verifying  : ibus-table-erbi-1.2.0.20090901-8.el6.noarch                13/13

Installed:
  ibus-table-chinese-cangjie.noarch 0:1.4.6-1.el6                              
  ibus-table-chinese-erbi.noarch 0:1.4.6-1.el6                                 
  ibus-table-chinese-scj.noarch 0:1.4.6-1.el6                                  
  ibus-table-chinese-wubi-haifeng.noarch 0:1.4.6-1.el6                         
  ibus-table-chinese-wubi-jidian.noarch 0:1.4.6-1.el6                          

Dependency Installed:
  ibus-table-chinese.noarch 0:1.4.6-1.el6                                      

Updated:
  clamav.x86_64 0:0.98.1-1.el6.rf         clamd.x86_64 0:0.98.1-1.el6.rf       

Replaced:
  ibus-table-cangjie.noarch 0:1.2.0.20100210-1.el6                             
  ibus-table-erbi.noarch 0:1.2.0.20090901-8.el6                                
  ibus-table-wubi.noarch 0:1.2.0.20090715-8.el6                                

Complete!

5.檢查clamAV的套件是否存在於套件庫
 [root@localhost ~]# yum list | grep clam
Existing lock /var/run/yum.pid: another copy is running as pid 13903.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 134 M RSS (985 MB VSZ)
    Started: Wed Apr 16 12:25:53 2014 - 00:10 ago
    State  : Sleeping, pid: 13903
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 134 M RSS (985 MB VSZ)
    Started: Wed Apr 16 12:25:53 2014 - 00:12 ago
    State  : Sleeping, pid: 13903
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory : 134 M RSS (985 MB VSZ)
    Started: Wed Apr 16 12:25:53 2014 - 00:14 ago
    State  : Sleeping, pid: 13903
clamav.x86_64                            0.98.1-1.el6.rf                @rpmforge
clamav-db.x86_64                         0.98.1-1.el6.rf                installed
clamd.x86_64                             0.98.1-1.el6.rf                @rpmforge
clamav.i686                              0.98.1-1.el6                   epel  
clamav-devel.i686                        0.98.1-1.el6                   epel  
clamav-devel.x86_64                      0.98.1-1.el6.rf                rpmforge
clamav-milter.x86_64                     0.98.1-1.el6.rf                rpmforge
clamav-unofficial-sigs.noarch            3.7.1-6.el6                    epel  
clamsmtp.x86_64                          1.10-6.el6                     epel  
clamtk.noarch                            4.25-1.el6.rf                  rpmforge
clamz.x86_64                             0.5-0.el6                      epel  
claws-mail-plugins-clamd.x86_64          3.9.0-2.el6                    epel  
[root@localhost ~]# yum install clamd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * epel: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * rpmforge: ftp.kddilabs.jp
 * updates: centosc6.centos.org
Setting up Install Process
Package clamd-0.98.1-1.el6.rf.x86_64 already installed and latest version
Nothing to do

6.將/etc/clamd.conf檔案中的
  TCPSocket 3310 加上註記#
  # TCPSocket 3310

7.重新啟動clamAV
  /etc/init.d/clamd start

 Starting Clam AntiVirus Daemon: LibClamAV Warning: **************************************************
LibClamAV Warning: ***  The virus database is older than 7 days!  ***
LibClamAV Warning: ***   Please update it as soon as possible.    ***
LibClamAV Warning: **************************************************
                                                           [  確定  ]


     
8.更新病毒碼
  freshclam
    
ClamAV update process started at Wed Apr 16 12:30:28 2014
nonblock_connect: connect timing out (30 secs)
Can't connect to port 80 of host db.tw.clamav.net (IP: 140.128.9.18)
Trying host db.tw.clamav.net (128.177.8.248)...
Downloading main-55.cdiff [100%]
main.cld updated (version: 55, sigs: 2424225, f-level: 60, builder: neo)
WARNING: getfile: daily-15077.cdiff not found on remote server (IP: 128.177.8.248)
WARNING: getpatch: Can't download daily-15077.cdiff from db.tw.clamav.net
WARNING: getpatch: Can't download daily-15077.cdiff from db.tw.clamav.net
WARNING: getpatch: Can't download daily-15077.cdiff from db.tw.clamav.net
WARNING: Incremental update failed, trying to download daily.cvd
nonblock_connect: connect timing out (30 secs)
Can't connect to port 80 of host db.tw.clamav.net (IP: 140.128.9.18)
Trying host db.tw.clamav.net (128.177.8.248)...
Downloading daily.cvd [100%]
daily.cvd updated (version: 18805, sigs: 891148, f-level: 63, builder: neo)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 236, sigs: 43, f-level: 63, builder: dgoddard)
Database updated (3315416 signatures) from db.tw.clamav.net (IP: 128.177.8.248)
Clamd successfully notified about the update

9.設定為每天自動更新一次病毒碼
  freshclam -d -c 2
 

10.自動執行clam
[root@localhost ~]# chkconfig clamd on
[root@localhost ~]# chkconfig --list | grep clamd

clamd              0:關閉    1:關閉    2:開啟    3:開啟    4:開啟    5:開啟    6:關閉

11.安裝ClamAV的圖形介面ClamTK
   連結至 http://code.google.com/p/clamtk/ 下載檔案安裝即可