无法运行 Freshclam

msy*_*msy 5 clamav

root@msy-Inspiron-One-2020:/home/msy# freshclam
ERROR: Missing argument for option at line 33
ERROR: Can't open/parse the config file /usr/local/etc/freshclam.conf
Run Code Online (Sandbox Code Playgroud)

这是/usr/local/etc/freshclam.conf

#Example
DatabaseDirectory /var/lib/clamav
##

## Example config file for freshclam
## Please read the clamav.conf(5) manual before editing this file.
## This file may be optionally merged with clamav.conf.
##

# You can change the default database directory here.
#DatabaseDirectory /var/lib/clamav
DatabaseDirectory /usr/local/clamav/share/clamav

# Path to the log file (make sure it has proper permissions)
UpdateLogFile /var/log/freshclam.log

# Enable verbose logging.    
LogVerbose

# Use system logger (can work together with UpdateLogFile).
LogSyslog

# By default when freshclam is started by root it drops privileges and
# switches to the "clamav" user. You can change this behaviour here.
#DatabaseOwner clamav

# The main database mirror is database.clamav.net (this is a round-robin
# DNS that points to many mirrors on the world) and in most cases you
# SHOULD NOT change it.
DatabaseMirror database.clamav.net

# How many attempts to make before giving up.
MaxAttempts 3

# How often check for a new database. We suggest checking for it every
# two hours.    
Checks 12

# Proxy settings
#HTTPProxyServer myproxy.com
#HTTPProxyPort 1234
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass    

# Send the RELOAD command to clamd.
#NotifyClamd [/optional/config/file/path]

# Run command after database update.
#OnUpdateExecute command

# Run command if database update failed.    
#OnErrorExecute command
Run Code Online (Sandbox Code Playgroud)

它出什么问题了?

Ter*_*nce 9

您正在运行缺少各种设置的 freshclam 配置文件的默认示例。

如果你运行:

sudo dpkg-reconfigure clamav-freshclam
Run Code Online (Sandbox Code Playgroud)

它将在/etc/clamav/文件夹中创建一个新的 freshclam.conf 文件。

从文件/usr/local/etc/夹中删除现有的 freshclam.conf 文件。

sudo rm -f /usr/local/etc/freshclam.conf
Run Code Online (Sandbox Code Playgroud)

然后创建一个指向新文件的链接,这样如果您必须再次运行它,conf 文件就会保持更新。

sudo ln -s /etc/clamav/freshclam.conf /usr/local/etc/freshclam.conf
Run Code Online (Sandbox Code Playgroud)

然后运行 ​​freshclam 进行更新。

sudo freshclam
Run Code Online (Sandbox Code Playgroud)

您可能会收到此错误:freshclam: error while loading shared libraries: libclamav.so.7: cannot open shared object file: No such file or directory,可以通过运行来修复:

sudo apt-get install --reinstall libclamav6
Run Code Online (Sandbox Code Playgroud)

或者对于 Ubuntu 16.04:

sudo apt-get install --reinstall libclamav7
Run Code Online (Sandbox Code Playgroud)

或者,我还没有尝试过这个,但据说它适用于任何发行版:

sudo ldconfig
Run Code Online (Sandbox Code Playgroud)