2

I am using perlbrew together with cpanm on debian wheezy. I tried to install Dist::Zilla but installation failed because of Net::SSLeay.

Error message: SSLeay.xs:153:25: fatal error: openssl/err.h: Datei oder Verzeichnis nicht gefunden (German for "openssl/err.h not found").

People suggest installing libssl-dev which I have already done and does not help.

Is it that something has changed from Squeeze to Wheezy and Perl-Modules are not aware of yet??

Community
  • 1
  • 1
Boris Däppen
  • 1,186
  • 7
  • 20
  • Have you tried `aptitude install libdist-zilla-perl`? Or you must install it with perlbrew/cpanm? I have just installed it like this (with 132 dependencies...) succcessfuly on a fresh wheezy box. – Michal Gasek Jan 20 '14 at 21:09
  • You mean it was successful with aptitude? Well this is no surprise :-) No it is not a must that I use perlbrew/cpanm, but it is my preferred work-flow. – Boris Däppen Jan 20 '14 at 21:38
  • Yes, no problems installing with aptitude... Save yourself trouble :) – Michal Gasek Jan 20 '14 at 21:38
  • 1
    Haha, you are joking. This motto was the reason why I switched to perlbrew! "Never mess with your systems Perl" seems logic to me while developing stuff. (but this is offtopic) – Boris Däppen Jan 20 '14 at 21:40
  • I'm not able to reproduce it. Here is the complete output of what I did together with complete log of cpanm: http://pastebin.com/TPd44inK , I included output of `perl -V` and `dpkg -l | grep ssl` as well. Anyway: `Successfully installed Net-SSLeay-1.58` && `Successfully installed Dist-Zilla-5.012`. – Michal Gasek Jan 21 '14 at 00:09
  • Also, what _people suggest_ is correct: `apt-file search /usr/include/openssl/err.h` => `libssl-dev: /usr/include/openssl/err.h`. Can you post your output of `perl -V` please? – Michal Gasek Jan 21 '14 at 00:29
  • I managed to reproduce exactly the same error eventually when libssl-dev package was not installed (thus `/usr/include/openssl/err.h` missing), but installing it fixed the issue. Again: please show `perl -V` and complete output of `cpanm -v Net::SSLeay`. There's a `--configure-args` experimental option in cpanm that you might be able to use to fix the issue. – Michal Gasek Jan 21 '14 at 01:28
  • Thank you so much for your effort. It seems like the installation of libssl-dev actually failed, and I missed that. OMG http://pastebin.com/njSyHA2J Still need to track down why this happens. Internet works fine. And my Wheezy is a relatively fresh setup. Strange – Boris Däppen Jan 21 '14 at 17:23
  • Fixed it! `aptitude update` and `aptitude safe-upgrade` brougth updates for `libssl1.0.0 libxfont1 openssl`. After that the installation went fine... If you give me an answer containing this, I'll accept it :-P – Boris Däppen Jan 21 '14 at 17:30

1 Answers1

1

The problem is likely that OpenSSL needs to be compiled into the Perlbrew environment -- the same environment that will run Net::SSLeay. Try this recipe:

  1. Install dependencies:

    sudo apt install build-essential checkinstall zlib1g-dev -y

  2. Create a subdirectory for OpenSSL under Perlbrew:

    mkdir ~/perl5/perlbrew/openssl

  3. Download & extract latest LTS OpenSSL into above directory. To determine latest LTS OpenSSL, go to https://openssl.org/source/ and find the latest stable version. For example below we use openssl-1.1.1.tar.gz:

    cd ~/perl5/perlbrew/openssl

    wget https://www.openssl.org/source/openssl-1.1.1.tar.gz [replace with latest LTS version]

    tar -xf openssl-1.1.1.tar.gz

    cd openssl-1.1.1

  4. Install and compile. Starting at above directory:

    ./config shared --prefix=$PERLBREW_ROOT/openssl

    make

    make test

  5. Install Net::SSLeay using cpanm:

    cpanm install Net::SSLeay

yahermann
  • 1,539
  • 1
  • 12
  • 33
  • 2
    This problem is 4 years old and the the solution was found in the comment section below the question. I'm no more capable of reproducing/veryfing anything on this questions. But I hope your answer may help those who come later. thx – Boris Däppen Nov 15 '18 at 13:08
  • 1
    Thank you @yahermann! This procedure was just what I needed to get XML::RPC installed on top of Perl 5.30 running on Perlbrew on Debian Stretch. – Medlock Perlman Mar 12 '20 at 13:22