Upgrading the Wazuh agent

The following steps show how to upgrade the Wazuh agent to the latest available version. Since Wazuh 3.x, it is possible to upgrade the Wazuh agents either remotely from the Wazuh manager or locally. Upgrading the Wazuh agents remotely is possible by using the agent_upgrade tool or the Wazuh API. More information about the process can be found in the Remote agent upgrade section.

To perform the upgrade locally, follow the instructions for the operating system of the Wazuh agent:

  1. Import the GPG key:

    # rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH
  2. Add the repository:

    # cat > /etc/yum.repos.d/wazuh.repo << EOF
    name=EL-$releasever - Wazuh
  3. Clean the YUM cache:

    # yum clean all
  4. Upgrade the Wazuh agent to the latest version:

    # yum upgrade wazuh-agent
  5. It is recommended to disable the Wazuh repository in order to avoid undesired upgrades and compatibility issues as the Wazuh agent should always be in the same or an older version than the Wazuh manager:

    # sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo

Once the Wazuh agent is upgraded, if it still uses UDP, which was the default protocol for versions prior to Wazuh 4.x, it must be changed to TCP in the ossec.conf file: