Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am unable to install Net::SSLeay. This is what I try:

To be sure that openSSL and headers are not missing:

$ sudo apt-get update $ sudo apt-get install libnet-ssleay-perl Reading package lists... Done Building dependency tree... Done Reading state information... Done libnet-ssleay-perl is already the newest version (1.92-1build2). 0 upgraded, 0 newly installed, 0 to remove and 38 not upgraded. $ cpan Net::SSLeay

This is the last part of the error:

SSLeay.c:16543:9: warning: ‘EVP_MD_CTX_md’ is deprecated: Since OpenSS +L 3.0 [-Wdeprecated-declarations] 16543 | RETVAL = EVP_MD_CTX_md(ctx); | ^~~~~~ In file included from /usr/include/openssl/rand.h:23, from SSLeay.xs:165: /usr/include/openssl/evp.h:555:15: note: declared here 555 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); | ^~~~~~~~~~~~~ rm -f blib/arch/auto/Net/SSLeay/SSLeay.so LD_RUN_PATH="/usr/lib/x86_64-linux-gnu" cc -shared -O2 -L/usr -L/usr/ +lib64 -L/usr/lib -L/usr/local/lib -fstack-protector-strong SSLeay.o + -o blib/arch/auto/Net/SSLeay/SSLeay.so \ -L/usr -L/usr/lib64 -L/usr/lib -lssl -lcrypto -lz \ /usr/bin/ld: cannot find -lz: No such file or directory collect2: error: ld returned 1 exit status make: *** [Makefile:495: blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1 CHRISN/Net-SSLeay-1.92.tar.gz make -- NOT OK

Any idea?

Replies are listed 'Best First'.
Re: Install Net::SSLeay on Ubuntu server
by choroba (Cardinal) on Aug 24, 2022 at 20:55 UTC
    /usr/bin/ld: cannot find -lz: No such file or directory collect2: error: ld returned 1 exit status

    Seems like you need the dev packages for -lz, i.e. something like zlib-devel.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re: Install Net::SSLeay on Ubuntu server
by Corion (Patriarch) on Aug 24, 2022 at 20:57 UTC

    You are mixing your OS package manager and your Perl installation. This will mainly lead to tears and a broken OS installation.

    The installation error you get from cpan likely means that libz resp. the libz-devel zlib-devel package is not installed.

Re: Install Net::SSLeay on Ubuntu server
by Anonymous Monk on Aug 24, 2022 at 20:57 UTC

    Doing this, solves the issue

    sudo apt-get install libnet-ssleay-perl sudo apt-get install libcrypt-ssleay-perl