Sorry for necrobumping but if anyone have similar problem in my case there was no lsb-release package in my system and for some reason in few cases, I must removed wazuh-agent before installation lsb-release So:
sudo apt remove wazuh-agent
and
sudo apt install lsb-release
and of course do all above answers including changing server address in /var/ossec/etc/ossec.conf after fresh install of wazuh-agent from server url