当我尝试安装 wazuh-manager 时遇到了这个问题:
root@hs1:/# apt install wazuh-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
wazuh-manager is already the newest version (4.1.5-1).
The following packages were automatically installed and are no longer required:
geoip-database libgeoip1
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up wazuh-manager (4.1.5-1) ...
/var/lib/dpkg/info/wazuh-manager.postinst: 46: cannot create /var/ossec/etc/ossec.conf: Directory nonexistent
dpkg: error processing package wazuh-manager (--configure):
installed wazuh-manager package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
wazuh-manager
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@hs1:/#
我确实卸载了 ossec-hids-agent 和服务器,并对
apt remove ossec-hids-agent && apt purge ossec-hids-agent
服务器也做了同样的操作,但是当我尝试安装它时仍然显示该错误...对于我尝试安装的任何其他包,我也会得到这个:
root@hs1:/# apt install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
net-tools is already the newest version (1.60+git20180626.aebd88e-1ubuntu1).
The following packages were automatically installed and are no longer required:
geoip-database libgeoip1
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up wazuh-manager (4.1.5-1) ...
/var/lib/dpkg/info/wazuh-manager.postinst: 46: cannot create /var/ossec/etc/ossec.conf: Directory nonexistent
dpkg: error processing package wazuh-manager (--configure):
installed wazuh-manager package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
wazuh-manager
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@hs1:/#
答案1
清除后您是否检查过该/var/ossec/
文件夹是否已被完全删除?
请检查它,然后检查 Wazuh 或 Ossec 是否仍安装(任何,代理或管理器)。
例如:
sudo dpkg -l | egrep -i "ossec|wazuh"
除此之外,验证是否有任何守护进程仍在运行:
ps -xa | grep ossec