Hi,

I wanted to try out plenv and install modules without "disturbing" system perl. Followed the instructions and plenv installed without any issues. While installing the Net::SSH2 modules, I kept getting errors. The steps given below are for those who might face similar issues. Hope someone here finds it helpful.

Apologies if this is posted in wrong section. Just wanted to post this to help those who might be in a similar situation

Before you install Net::SSH2, install the following:

sudo apt install libssh2-1-dev sudo apt install openssh-server sudo apt install zlib1g-dev

Once these are installed successfully, then proceed with installing the Net::SSH2 module. Since I had earlier installed plenv, it seems to have installed cpanm in my home directory as shown below.

pritesh@thinkpad:~$ which cpanm /home/pritesh/.plenv/shims/cpanm pritesh@thinkpad:~$

Then I simply installed Net::SSH2 using the following command

cpanm Net::SSH2

Then just to see if all is well, I ran the following command

pritesh@thinkpad:~$ perl -e "Net::SSH2" pritesh@thinkpad:~$

Updated as per the error pointed out. Thanks.

pritesh@thinkpad:~$ perl -e "use Net::SSH2" pritesh@thinkpad:~$

Indeed all is well.

Note:- Big thank you to the Strawberry Perl folks. While on Windows, I was using Strawberry Perl and installing a module was trivial. Only upon trying to install the Net::SSH2 module on linux did I understand how much care the Strawberry Perl folks have taken to make things work on Windows.

Unfortunately I will not be able to go back to Windows on this laptop. After upgrading the RAM, Windows would not boot. Reinstalling the OS also did not help and I kept getting random blue screens, both with Windows 7 and 10. Memory tests ran all fine. So tried Ubuntu 16.04.2 and it seems to have no issues.


In reply to Resolving issues while installing Net::SSH2 on Ubuntu 16.04.2 by pritesh_ugrankar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.