admin管理员组

文章数量:1651089

安装一个杀毒软

  • 安装过程 这里[^1]

安装过程 这里1

sudo apt-get update
sudo apt-get install clamav clamav-daemon
clamscan --version

如果这句代码能运行并且返回版本号,说明已经成功了一小半,但是坑还在后面

sudo systemctl stop clamav-freshclam

报错是这个

Failed to stop clamav-freshclam.service: Unit clamav-freshclam.service not loaded.

我没管他,继续运行

sudo freshclam

这句代码的意思是要更新病毒库
返回这个

Failed to stop clamav-freshclam.service: Unit clamav-freshclam.service not loaded.

OK软件没装成,回头检查一下再装

sudo apt-get update
sudo apt-get install clamav
sudo apt-get install clamtk
sudo apt-get install clamav-daemon

第三行装的是一个图形界面软件
在运行又报错

sudo systemctl stop clamav-freshclam
sudo freshclam

第一句算是运行正常了,然后第二句返回

ERROR: Can’t open/parse the config file /usr/local/etc/freshclam.conf

OK,那个帖子的大佬又说如果报错可能是因为缺少文件
https://database.clamav/daily.cvd
下载下来之后放到这里
/var/lib/clamav/
如果没有这个目录就创建一个目录,然后我把下载下来的文件丢进去,在运行

sudo systemctl start clamav-freshclam
sudo clamscan --infected --recursive --remove /

第二句代码的意思是全局杀毒

返回这个

LibClamAV Error: cl_load(): No such file or directory: /usr/local/share/clamav
ERROR: Can’t get file status

这里要注意如果有这个报错要看下他说的这个目录有没有,没有还要重新创建一个
最后终于弄明白,这句代码

sudo freshclam

返回的这句

ERROR: Can’t open/parse the config file /usr/local/etc/freshclam.conf

意思是/usr/local/etc/目录下没有freshclam.conf这个文件,我进到这个目录里面一看,原来有个freshclam.conf.sample文件,OK直接原地复制,然后改下文件名就行,结果运行又报错

sudo freshclam

ERROR: Please edit the example config file /usr/local/etc/freshclam.conf
ERROR: Can’t open/parse the config file /usr/local/etc/freshclam.conf

OK,说是这个config里面有一行example代码要注释掉,很简单,直接进去注释,完成

运行上一句代码又报错

ERROR: Can’t create freshclam.dat in /usr/local/share/clamav
Hint: The database directory must be writable for UID 124 or GID 129

这里好像权限不够,直接改一下文件权限

sudo chmod 777 /usr/local/share/clamav/

在运行上一句代码终于成功了,吐了
后续如果有问题我再来补充
[1]: http://meta.math.stackexchange/questions/5020/mathjax-basic-tutorial-and-quick-reference
[2]: https://mermaidjs.github.io/
[3]: https://mermaidjs.github.io/
[4]: http://adrai.github.io/flowchart.js/


  1. https://linuxhint/install_clamav_ubuntu/
    安装这个东西的代码如下 ↩︎

本文标签: 杀毒软件LinuxUbuntu