Building Wazuh agent from sources

312 Views Asked by At

I'm trying to build the wazuh agent for windows from source, following the official documentation https://documentation.wazuh.com/current/deployment-options/wazuh-from-sources/wazuh-agent/index.html. This guide is said to be tested on Ubuntu 20.04 but after typing:

make deps TARGET=winagent

make TARGET=winagent

I got the following error:

grep: /etc/redhat-release: No such file or directory
curl -so external/cJSON.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/cJSON.tar.gz || true
cd external && test -e cJSON.tar.gz && gunzip cJSON.tar.gz || true
cd external && test -e cJSON.tar && tar -xf cJSON.tar || true
test -e external/cJSON.tar && rm external/cJSON.tar || true
test -d external/cJSON ||\
(curl -so external/cJSON.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/cJSON.tar.gz &&\
cd external && gunzip cJSON.tar.gz && tar -xf cJSON.tar && rm cJSON.tar)
curl -so external/curl.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/curl.tar.gz || true
cd external && test -e curl.tar.gz && gunzip curl.tar.gz || true
cd external && test -e curl.tar && tar -xf curl.tar || true
test -e external/curl.tar && rm external/curl.tar || true
test -d external/curl ||\
(curl -so external/curl.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/curl.tar.gz &&\
cd external && gunzip curl.tar.gz && tar -xf curl.tar && rm curl.tar)
curl -so external/libdb.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libdb.tar.gz || true
cd external && test -e libdb.tar.gz && gunzip libdb.tar.gz || true
cd external && test -e libdb.tar && tar -xf libdb.tar || true
test -e external/libdb.tar && rm external/libdb.tar || true
test -d external/libdb ||\
(curl -so external/libdb.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libdb.tar.gz &&\
cd external && gunzip libdb.tar.gz && tar -xf libdb.tar && rm libdb.tar)
curl -so external/libffi.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libffi.tar.gz || true
cd external && test -e libffi.tar.gz && gunzip libffi.tar.gz || true
cd external && test -e libffi.tar && tar -xf libffi.tar || true
test -e external/libffi.tar && rm external/libffi.tar || true
test -d external/libffi ||\
(curl -so external/libffi.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libffi.tar.gz &&\
cd external && gunzip libffi.tar.gz && tar -xf libffi.tar && rm libffi.tar)
curl -so external/libyaml.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libyaml.tar.gz || true
cd external && test -e libyaml.tar.gz && gunzip libyaml.tar.gz || true
cd external && test -e libyaml.tar && tar -xf libyaml.tar || true
test -e external/libyaml.tar && rm external/libyaml.tar || true
test -d external/libyaml ||\
(curl -so external/libyaml.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libyaml.tar.gz &&\
cd external && gunzip libyaml.tar.gz && tar -xf libyaml.tar && rm libyaml.tar)
curl -so external/openssl.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/openssl.tar.gz || true
cd external && test -e openssl.tar.gz && gunzip openssl.tar.gz || true
cd external && test -e openssl.tar && tar -xf openssl.tar || true
test -e external/openssl.tar && rm external/openssl.tar || true
test -d external/openssl ||\
(curl -so external/openssl.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/openssl.tar.gz &&\
cd external && gunzip openssl.tar.gz && tar -xf openssl.tar && rm openssl.tar)
curl -so external/procps.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/procps.tar.gz || true
cd external && test -e procps.tar.gz && gunzip procps.tar.gz || true
cd external && test -e procps.tar && tar -xf procps.tar || true
test -e external/procps.tar && rm external/procps.tar || true
test -d external/procps ||\
(curl -so external/procps.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/procps.tar.gz &&\
cd external && gunzip procps.tar.gz && tar -xf procps.tar && rm procps.tar)
curl -so external/sqlite.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/sqlite.tar.gz || true
cd external && test -e sqlite.tar.gz && gunzip sqlite.tar.gz || true
cd external && test -e sqlite.tar && tar -xf sqlite.tar || true
test -e external/sqlite.tar && rm external/sqlite.tar || true
test -d external/sqlite ||\
(curl -so external/sqlite.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/sqlite.tar.gz &&\
cd external && gunzip sqlite.tar.gz && tar -xf sqlite.tar && rm sqlite.tar)
curl -so external/zlib.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/zlib.tar.gz || true
cd external && test -e zlib.tar.gz && gunzip zlib.tar.gz || true
cd external && test -e zlib.tar && tar -xf zlib.tar || true
test -e external/zlib.tar && rm external/zlib.tar || true
test -d external/zlib ||\
(curl -so external/zlib.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/zlib.tar.gz &&\
cd external && gunzip zlib.tar.gz && tar -xf zlib.tar && rm zlib.tar)
curl -so external/audit-userspace.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/audit-userspace.tar.gz || true
cd external && test -e audit-userspace.tar.gz && gunzip audit-userspace.tar.gz || true

gzip: audit-userspace.tar.gz: not in gzip format
cd external && test -e audit-userspace.tar && tar -xf audit-userspace.tar || true
test -e external/audit-userspace.tar && rm external/audit-userspace.tar || true
test -d external/audit-userspace ||\
(curl -so external/audit-userspace.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/audit-userspace.tar.gz &&\
cd external && gunzip audit-userspace.tar.gz && tar -xf audit-userspace.tar && rm audit-userspace.tar)
curl -so external/msgpack.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/msgpack.tar.gz || true
cd external && test -e msgpack.tar.gz && gunzip msgpack.tar.gz || true
cd external && test -e msgpack.tar && tar -xf msgpack.tar || true
test -e external/msgpack.tar && rm external/msgpack.tar || true
test -d external/msgpack ||\
(curl -so external/msgpack.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/msgpack.tar.gz &&\
cd external && gunzip msgpack.tar.gz && tar -xf msgpack.tar && rm msgpack.tar)
curl -so external/bzip2.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/bzip2.tar.gz || true
cd external && test -e bzip2.tar.gz && gunzip bzip2.tar.gz || true
cd external && test -e bzip2.tar && tar -xf bzip2.tar || true
test -e external/bzip2.tar && rm external/bzip2.tar || true
test -d external/bzip2 ||\
(curl -so external/bzip2.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/bzip2.tar.gz &&\
cd external && gunzip bzip2.tar.gz && tar -xf bzip2.tar && rm bzip2.tar)
curl -so external/nlohmann.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/nlohmann.tar.gz || true
cd external && test -e nlohmann.tar.gz && gunzip nlohmann.tar.gz || true

gzip: nlohmann.tar.gz: not in gzip format
cd external && test -e nlohmann.tar && tar -xf nlohmann.tar || true
test -e external/nlohmann.tar && rm external/nlohmann.tar || true
test -d external/nlohmann ||\
(curl -so external/nlohmann.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/nlohmann.tar.gz &&\
cd external && gunzip nlohmann.tar.gz && tar -xf nlohmann.tar && rm nlohmann.tar)
curl -so external/googletest.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/googletest.tar.gz || true
cd external && test -e googletest.tar.gz && gunzip googletest.tar.gz || true

gzip: googletest.tar.gz: not in gzip format
cd external && test -e googletest.tar && tar -xf googletest.tar || true
test -e external/googletest.tar && rm external/googletest.tar || true
test -d external/googletest ||\
(curl -so external/googletest.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/googletest.tar.gz &&\
cd external && gunzip googletest.tar.gz && tar -xf googletest.tar && rm googletest.tar)
curl -so external/libpcre2.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libpcre2.tar.gz || true
cd external && test -e libpcre2.tar.gz && gunzip libpcre2.tar.gz || true
cd external && test -e libpcre2.tar && tar -xf libpcre2.tar || true
test -e external/libpcre2.tar && rm external/libpcre2.tar || true
test -d external/libpcre2 ||\
(curl -so external/libpcre2.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libpcre2.tar.gz &&\
cd external && gunzip libpcre2.tar.gz && tar -xf libpcre2.tar && rm libpcre2.tar)
curl -so external/libplist.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libplist.tar.gz || true
cd external && test -e libplist.tar.gz && gunzip libplist.tar.gz || true
cd external && test -e libplist.tar && tar -xf libplist.tar || true
test -e external/libplist.tar && rm external/libplist.tar || true
test -d external/libplist ||\
(curl -so external/libplist.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libplist.tar.gz &&\
cd external && gunzip libplist.tar.gz && tar -xf libplist.tar && rm libplist.tar)
curl -so external/pacman.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/pacman.tar.gz || true
cd external && test -e pacman.tar.gz && gunzip pacman.tar.gz || true

gzip: pacman.tar.gz: not in gzip format
cd external && test -e pacman.tar && tar -xf pacman.tar || true
test -e external/pacman.tar && rm external/pacman.tar || true
test -d external/pacman ||\
(curl -so external/pacman.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/pacman.tar.gz &&\
cd external && gunzip pacman.tar.gz && tar -xf pacman.tar && rm pacman.tar)
curl -so external/libarchive.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libarchive.tar.gz || true
cd external && test -e libarchive.tar.gz && gunzip libarchive.tar.gz || true

gzip: libarchive.tar.gz: not in gzip format
cd external && test -e libarchive.tar && tar -xf libarchive.tar || true
test -e external/libarchive.tar && rm external/libarchive.tar || true
test -d external/libarchive ||\
(curl -so external/libarchive.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libarchive.tar.gz &&\
cd external && gunzip libarchive.tar.gz && tar -xf libarchive.tar && rm libarchive.tar)
curl -so external/popt.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/popt.tar.gz || true
cd external && test -e popt.tar.gz && gunzip popt.tar.gz || true

gzip: popt.tar.gz: not in gzip format
cd external && test -e popt.tar && tar -xf popt.tar || true
test -e external/popt.tar && rm external/popt.tar || true
test -d external/popt ||\
(curl -so external/popt.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/popt.tar.gz &&\
cd external && gunzip popt.tar.gz && tar -xf popt.tar && rm popt.tar)
curl -so external/rpm.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/rpm.tar.gz || true
cd external && test -e rpm.tar.gz && gunzip rpm.tar.gz || true

gzip: rpm.tar.gz: not in gzip format
cd external && test -e rpm.tar && tar -xf rpm.tar || true
test -e external/rpm.tar && rm external/rpm.tar || true
test -d external/rpm ||\
(curl -so external/rpm.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/rpm.tar.gz &&\
cd external && gunzip rpm.tar.gz && tar -xf rpm.tar && rm rpm.tar)
grep: /etc/redhat-release: No such file or directory
cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll win32/libwinpthread-1.dll
cp  win32/libgcc_s_sjlj-1.dll
cp: missing destination file operand after 'win32/libgcc_s_sjlj-1.dll'
Try 'cp --help' for more information.
make: *** [Makefile:781: win32/libgcc_s_sjlj-1.dll] Error 1         

That I solved by commenting out the line #CHECK_CENTOS5 := $(shell sh -c 'grep "CentOS release 5." /etc/redhat-release > /dev/null && echo YES || echo not') In the Makefile

Now I get the following error the I'm not able to solve

curl -so external/cJSON.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/cJSON.tar.gz || true
cd external && test -e cJSON.tar.gz && gunzip cJSON.tar.gz || true
cd external && test -e cJSON.tar && tar -xf cJSON.tar || true
test -e external/cJSON.tar && rm external/cJSON.tar || true
test -d external/cJSON ||\
(curl -so external/cJSON.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/cJSON.tar.gz &&\
cd external && gunzip cJSON.tar.gz && tar -xf cJSON.tar && rm cJSON.tar)
curl -so external/curl.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/curl.tar.gz || true
cd external && test -e curl.tar.gz && gunzip curl.tar.gz || true
cd external && test -e curl.tar && tar -xf curl.tar || true
test -e external/curl.tar && rm external/curl.tar || true
test -d external/curl ||\
(curl -so external/curl.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/curl.tar.gz &&\
cd external && gunzip curl.tar.gz && tar -xf curl.tar && rm curl.tar)
curl -so external/libdb.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libdb.tar.gz || true
cd external && test -e libdb.tar.gz && gunzip libdb.tar.gz || true
cd external && test -e libdb.tar && tar -xf libdb.tar || true
test -e external/libdb.tar && rm external/libdb.tar || true
test -d external/libdb ||\
(curl -so external/libdb.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libdb.tar.gz &&\
cd external && gunzip libdb.tar.gz && tar -xf libdb.tar && rm libdb.tar)
curl -so external/libffi.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libffi.tar.gz || true
cd external && test -e libffi.tar.gz && gunzip libffi.tar.gz || true
cd external && test -e libffi.tar && tar -xf libffi.tar || true
test -e external/libffi.tar && rm external/libffi.tar || true
test -d external/libffi ||\
(curl -so external/libffi.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libffi.tar.gz &&\
cd external && gunzip libffi.tar.gz && tar -xf libffi.tar && rm libffi.tar)
curl -so external/libyaml.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libyaml.tar.gz || true
cd external && test -e libyaml.tar.gz && gunzip libyaml.tar.gz || true
cd external && test -e libyaml.tar && tar -xf libyaml.tar || true
test -e external/libyaml.tar && rm external/libyaml.tar || true
test -d external/libyaml ||\
(curl -so external/libyaml.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libyaml.tar.gz &&\
cd external && gunzip libyaml.tar.gz && tar -xf libyaml.tar && rm libyaml.tar)
curl -so external/openssl.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/openssl.tar.gz || true
cd external && test -e openssl.tar.gz && gunzip openssl.tar.gz || true
cd external && test -e openssl.tar && tar -xf openssl.tar || true
test -e external/openssl.tar && rm external/openssl.tar || true
test -d external/openssl ||\
(curl -so external/openssl.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/openssl.tar.gz &&\
cd external && gunzip openssl.tar.gz && tar -xf openssl.tar && rm openssl.tar)
curl -so external/procps.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/procps.tar.gz || true
cd external && test -e procps.tar.gz && gunzip procps.tar.gz || true
cd external && test -e procps.tar && tar -xf procps.tar || true
test -e external/procps.tar && rm external/procps.tar || true
test -d external/procps ||\
(curl -so external/procps.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/procps.tar.gz &&\
cd external && gunzip procps.tar.gz && tar -xf procps.tar && rm procps.tar)
curl -so external/sqlite.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/sqlite.tar.gz || true
cd external && test -e sqlite.tar.gz && gunzip sqlite.tar.gz || true
cd external && test -e sqlite.tar && tar -xf sqlite.tar || true
test -e external/sqlite.tar && rm external/sqlite.tar || true
test -d external/sqlite ||\
(curl -so external/sqlite.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/sqlite.tar.gz &&\
cd external && gunzip sqlite.tar.gz && tar -xf sqlite.tar && rm sqlite.tar)
curl -so external/zlib.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/zlib.tar.gz || true
cd external && test -e zlib.tar.gz && gunzip zlib.tar.gz || true
cd external && test -e zlib.tar && tar -xf zlib.tar || true
test -e external/zlib.tar && rm external/zlib.tar || true
test -d external/zlib ||\
(curl -so external/zlib.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/zlib.tar.gz &&\
cd external && gunzip zlib.tar.gz && tar -xf zlib.tar && rm zlib.tar)
curl -so external/audit-userspace.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/audit-userspace.tar.gz || true
cd external && test -e audit-userspace.tar.gz && gunzip audit-userspace.tar.gz || true

gzip: audit-userspace.tar.gz: not in gzip format
cd external && test -e audit-userspace.tar && tar -xf audit-userspace.tar || true
test -e external/audit-userspace.tar && rm external/audit-userspace.tar || true
test -d external/audit-userspace ||\
(curl -so external/audit-userspace.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/audit-userspace.tar.gz &&\
cd external && gunzip audit-userspace.tar.gz && tar -xf audit-userspace.tar && rm audit-userspace.tar)
curl -so external/msgpack.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/msgpack.tar.gz || true
cd external && test -e msgpack.tar.gz && gunzip msgpack.tar.gz || true
cd external && test -e msgpack.tar && tar -xf msgpack.tar || true
test -e external/msgpack.tar && rm external/msgpack.tar || true
test -d external/msgpack ||\
(curl -so external/msgpack.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/msgpack.tar.gz &&\
cd external && gunzip msgpack.tar.gz && tar -xf msgpack.tar && rm msgpack.tar)
curl -so external/bzip2.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/bzip2.tar.gz || true
cd external && test -e bzip2.tar.gz && gunzip bzip2.tar.gz || true
cd external && test -e bzip2.tar && tar -xf bzip2.tar || true
test -e external/bzip2.tar && rm external/bzip2.tar || true
test -d external/bzip2 ||\
(curl -so external/bzip2.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/bzip2.tar.gz &&\
cd external && gunzip bzip2.tar.gz && tar -xf bzip2.tar && rm bzip2.tar)
curl -so external/nlohmann.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/nlohmann.tar.gz || true
cd external && test -e nlohmann.tar.gz && gunzip nlohmann.tar.gz || true

gzip: nlohmann.tar.gz: not in gzip format
cd external && test -e nlohmann.tar && tar -xf nlohmann.tar || true
test -e external/nlohmann.tar && rm external/nlohmann.tar || true
test -d external/nlohmann ||\
(curl -so external/nlohmann.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/nlohmann.tar.gz &&\
cd external && gunzip nlohmann.tar.gz && tar -xf nlohmann.tar && rm nlohmann.tar)
curl -so external/googletest.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/googletest.tar.gz || true
cd external && test -e googletest.tar.gz && gunzip googletest.tar.gz || true

gzip: googletest.tar.gz: not in gzip format
cd external && test -e googletest.tar && tar -xf googletest.tar || true
test -e external/googletest.tar && rm external/googletest.tar || true
test -d external/googletest ||\
(curl -so external/googletest.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/googletest.tar.gz &&\
cd external && gunzip googletest.tar.gz && tar -xf googletest.tar && rm googletest.tar)
curl -so external/libpcre2.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libpcre2.tar.gz || true
cd external && test -e libpcre2.tar.gz && gunzip libpcre2.tar.gz || true
cd external && test -e libpcre2.tar && tar -xf libpcre2.tar || true
test -e external/libpcre2.tar && rm external/libpcre2.tar || true
test -d external/libpcre2 ||\
(curl -so external/libpcre2.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libpcre2.tar.gz &&\
cd external && gunzip libpcre2.tar.gz && tar -xf libpcre2.tar && rm libpcre2.tar)
curl -so external/libplist.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libplist.tar.gz || true
cd external && test -e libplist.tar.gz && gunzip libplist.tar.gz || true
cd external && test -e libplist.tar && tar -xf libplist.tar || true
test -e external/libplist.tar && rm external/libplist.tar || true
test -d external/libplist ||\
(curl -so external/libplist.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libplist.tar.gz &&\
cd external && gunzip libplist.tar.gz && tar -xf libplist.tar && rm libplist.tar)
curl -so external/pacman.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/pacman.tar.gz || true
cd external && test -e pacman.tar.gz && gunzip pacman.tar.gz || true

gzip: pacman.tar.gz: not in gzip format
cd external && test -e pacman.tar && tar -xf pacman.tar || true
test -e external/pacman.tar && rm external/pacman.tar || true
test -d external/pacman ||\
(curl -so external/pacman.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/pacman.tar.gz &&\
cd external && gunzip pacman.tar.gz && tar -xf pacman.tar && rm pacman.tar)
curl -so external/libarchive.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/libarchive.tar.gz || true
cd external && test -e libarchive.tar.gz && gunzip libarchive.tar.gz || true

gzip: libarchive.tar.gz: not in gzip format
cd external && test -e libarchive.tar && tar -xf libarchive.tar || true
test -e external/libarchive.tar && rm external/libarchive.tar || true
test -d external/libarchive ||\
(curl -so external/libarchive.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/libarchive.tar.gz &&\
cd external && gunzip libarchive.tar.gz && tar -xf libarchive.tar && rm libarchive.tar)
curl -so external/popt.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/popt.tar.gz || true
cd external && test -e popt.tar.gz && gunzip popt.tar.gz || true

gzip: popt.tar.gz: not in gzip format
cd external && test -e popt.tar && tar -xf popt.tar || true
test -e external/popt.tar && rm external/popt.tar || true
test -d external/popt ||\
(curl -so external/popt.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/popt.tar.gz &&\
cd external && gunzip popt.tar.gz && tar -xf popt.tar && rm popt.tar)
curl -so external/rpm.tar.gz https://packages.wazuh.com/deps/17/libraries/windows/rpm.tar.gz || true
cd external && test -e rpm.tar.gz && gunzip rpm.tar.gz || true

gzip: rpm.tar.gz: not in gzip format
cd external && test -e rpm.tar && tar -xf rpm.tar || true
test -e external/rpm.tar && rm external/rpm.tar || true
test -d external/rpm ||\
(curl -so external/rpm.tar.gz https://packages.wazuh.com/deps/17/libraries/sources/rpm.tar.gz &&\
cd external && gunzip rpm.tar.gz && tar -xf rpm.tar && rm rpm.tar)
cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll win32/libwinpthread-1.dll
cp  win32/libgcc_s_sjlj-1.dll
cp: missing destination file operand after 'win32/libgcc_s_sjlj-1.dll'
Try 'cp --help' for more information.
make: *** [Makefile:781: win32/libgcc_s_sjlj-1.dll] Error 1
                                                 
1

There are 1 best solutions below

0
On

Its not recommended to edit the files by commenting lines to avoid errors, since the installer contains all the necessary steps to install the agent correctly.

After several tests I was able to reproduce the error, and it was when I tried to generate the agent in Ubuntu 22. This is an expected behavior as Wazuh version 4.3 is not supported for Ubuntu 22.

The documentation did not mention the repository update step, please run an apt-get update command at the beginning of the installation and then repeat all the steps again, make sure that the system is Ubuntu 20.

Also, make sure that all dependencies are installed correctly as the error shown for libgcc_s_sjlj-1.dll is related to the mingw dependency.