Score:0

Fix Broken APT Installing

vu flag

When i try to install wazuh-manager i get this issue:

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:/#

I did uninstall ossec-hids-agent and server using the apt remove ossec-hids-agent && apt purge ossec-hids-agent and the same for the server but still shows that error when i try to install it... For any other package i try to install i get this aswell:

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:/#
user535733 avatar
cn flag
Is there something stopping you from simply creating the missing directory?
Score:0
mn flag

Did you check after the purge that /var/ossec/ folder was completely removed?

Please check it and after that check if Wazuh or Ossec is still installed (any, Agent or Manager).
For instance:

sudo dpkg -l | egrep -i "ossec|wazuh"

In addition to this, verify if any daemon still running:

ps -xa | grep ossec
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.