# Stop and disable the Wazuh manager service sudo systemctl stop wazuh-manager sudo systemctl disable wazuh-manager # Stop and disable the Filebeat service sudo systemctl stop filebeat sudo systemctl disable filebeat # Remove Wazuh manager package sudo apt-get remove --purge -y wazuh-manager # Remove Filebeat package sudo apt-get remove --purge -y filebeat # Clean up any remaining configuration files or dependencies sudo apt-get autoremove -y sudo apt-get clean # Optionally, remove the Wazuh repository file sudo rm /etc/apt/sources.list.d/wazuh.list # Remove any residual directories if necessary sudo rm -rf /var/ossec /etc/filebeat /etc/apt/sources.list.d/wazuh.list