Upgrading the Wazuh agent from 2.x to 3.x
The following steps show how to upgrade the Wazuh agent from 2.x to 3.x.
Upgrading the Wazuh agent
To upgrade the Wazuh agent, choose the appropriate tab for the desired operating system:
Add the new repository for Wazuh 3.x:
# cat > /etc/yum.repos.d/wazuh.repo <<\EOF [wazuh_repo] gpgcheck=1 gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH enabled=1 name=Wazuh repository baseurl=https://packages.wazuh.com/4.x/yum/ protect=1 EOFUpgrade the Wazuh agent:
# yum install wazuh-agentIt 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 lower version than the Wazuh manager:
# sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repoAdd the new repository for Wazuh 3.x:
# echo "deb https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.listUpgrade the Wazuh agent:
# apt-get update # apt-get install wazuh-agentIt 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 lower version than the Wazuh manager:
# sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list # apt-get updateAlternatively, the user can set the package state to
hold
, which will stop updates. It will be still possible to upgrade it manually usingapt-get install
:# echo "wazuh-agent hold" | sudo dpkg --set-selectionsAdd the new repository for Wazuh 3.x:
# rpm --import https://packages.wazuh.com/key/GPG-KEY-WAZUH # cat > /etc/zypp/repos.d/wazuh.repo <<\EOF [wazuh_repo] gpgcheck=1 gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH enabled=1 autorefresh=1 name=Wazuh repository baseurl=https://packages.wazuh.com/4.x/yum/ protect=1 EOFUpgrade the Wazuh agent:
# zypper update wazuh-agentIt 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 lower version than the Wazuh manager:
# sed -i "s/^enabled=1/enabled=0/" /etc/zypp/repos.d/wazuh.repoThe Wazuh agent upgrade process for Windows systems requires to download the latest available installer from the packages list. There are two ways of using it, both require
administrator rights
:
Using the GUI installer:
Open the installer and follow the instructions to upgrade the Wazuh agent:
Using the command line:
To upgrade the Wazuh agent from the command line, run the installer using Windows PowerShell or the command prompt. The
/q
argument is used for unattended installations:# wazuh-agent-4.5.4-1.msi /qNote
To learn more about the unattended installation process, please read the Windows installation guide.
On MacOS X system the Wazuh agent upgrade can be done by deleting the previous version and installing the newest version of the Wazuh agent from scratch. As the Wazuh agent's
ossec.conf
configuration file will be overwritten it is recommended to backup the old configuration file and import previous settings where needed.More information about the process can be found in the Wazuh agent installation and deployment on MacOS X section.
On the Unix based systems the Wazuh agent upgrade can be done by deleting the previous version and installing the newest version of the Wazuh agent from scratch. As the Wazuh agent's
ossec.conf
configuration file will be overwritten it is recommended to backup the old configuration file and import previous settings where needed.More information about the process can be found following the appropriate link for the desired operating system: