Uninstalling the Wazuh agent
This section describes how to uninstall Wazuh agents installed across the different operating systems below:
Uninstalling a Linux Wazuh agent
Run the following commands to uninstall a Linux agent.
Note
To uninstall Wazuh agent from a Linux endpoint with the anti-tampering feature enabled, refer to Uninstalling an agent with anti-tampering enabled.
Remove the Wazuh agent installation.
# apt-get remove wazuh-agent
Some files are marked as configuration files. Due to this designation, the package manager does not remove these files from the filesystem. Run the following command If you want to remove all files completely.
# apt-get remove --purge wazuh-agent
# yum remove wazuh-agent
Some files are marked as configuration files. Due to this designation, the package manager does not remove these files from the filesystem. Delete the
/var/ossec/folder if you want to remove all files completely.# dnf remove wazuh-agent
Some files are marked as configuration files. Due to this designation, the package manager does not remove these files from the filesystem. Delete the
/var/ossec/folder if you want to remove all files completely.# zypper remove wazuh-agent
Some files are marked as configuration files. Due to this designation, the package manager does not remove these files from the filesystem. Delete the
/var/ossec/folder if you want to remove all files completely.Disable the Wazuh agent service.
# systemctl disable wazuh-agent # systemctl daemon-reload
Choose one option according to your operating system.
RPM-based operating systems:
# chkconfig wazuh-agent off # chkconfig --del wazuh-agent
Debian-based operating systems:
# update-rc.d -f wazuh-agent remove
No action required.
The Wazuh agent is now completely removed from your Linux endpoint.
Uninstalling a Windows Wazuh agent
To uninstall the Wazuh agent, ensure the original Windows installer file is in your working directory and run the following command:
> msiexec.exe /x wazuh-agent-5.0.0-1.msi /qn
The Wazuh agent is now completely removed from your Windows endpoint.
Uninstalling a macOS Wazuh agent
Follow these steps to uninstall the Wazuh agent from your macOS endpoint.
Stop the Wazuh agent service.
# launchctl bootout system /Library/LaunchDaemons/com.wazuh.agent.plist
Remove the
/Library/Ossec/folder.# /bin/rm -r /Library/Ossec
Remove
launchdaemonsandStartupItems.# /bin/rm -f /Library/LaunchDaemons/com.wazuh.agent.plist # /bin/rm -rf /Library/StartupItems/WAZUH
Remove the Wazuh user and group.
# /usr/bin/dscl . -delete "/Users/wazuh" # /usr/bin/dscl . -delete "/Groups/wazuh"
Remove from
pkgutil.# /usr/sbin/pkgutil --forget com.wazuh.pkg.wazuh-agent
The Wazuh agent is now completely removed from your macOS endpoint.