By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,561 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

problems installing module Net::SFTP

P: 63
Hi,
I'm using Ubuntu 7.04.

I'm writing a sript that sends files via ftp for several destinations.
So far I used Net::FTP and it worked fine.

My problem is that I need to send files via SFTP (SSH2). I've been trying to install Net::SFTP with 'sudo perl -MCPAN -e "install NET::SFTP' but I can't. It stops in the middle of the installation:

Expand|Select|Wrap|Line Numbers
  1. Crypt-DH-0.06/t/
  2. Crypt-DH-0.06/t/00-compile.t
  3. Crypt-DH-0.06/t/01-dh.t
  4. Crypt-DH-0.06/ToDo
  5. Removing previously used /home/joao/.cpan/build/Crypt-DH-0.06
  6.  
  7.   CPAN.pm: Going to build B/BT/BTROTT/Crypt-DH-0.06.tar.gz
  8.  
  9. *** ExtUtils::AutoInstall version 0.56
  10. *** Checking for dependencies...
  11. [Core Features]
  12. - Math::BigInt ...loaded. (1.77 >= 1.60)
  13. *** ExtUtils::AutoInstall configuration finished.
  14. Checking if your kit is complete...
  15. Looks good
  16. Writing Makefile for Crypt::DH
  17. cp lib/Crypt/DH.pm blib/lib/Crypt/DH.pm
  18. Manifying blib/man3/Crypt::DH.3pm
  19.   /usr/bin/make  -- OK
  20. Running make test
  21. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-compile.t t/01-dh.t
  22. t/00-compile....ok                                                           
  23. t/01-dh.........ok 15/18
If I use CTRL-C it finishes but with errors and I can't use the module in my scripts.

Can someone help me to install this, or another module that can SFTP or some other way to get my goal?

Thanks in advance for any help,

Joo
Oct 29 '07 #1
Share this Question
Share on Google+
12 Replies


eWish
Expert 100+
P: 971
What errors are you getting?
Oct 30 '07 #2

P: 63
The problem is installing the dependency Net::SSH::Perl.
I tried to install it separately and got the same error!

the installation stops in this "15/18".
If I leave it "die" for it self, the result is the same.
this is the output til the end:

I have cut some of the output because was too big for one post

Expand|Select|Wrap|Line Numbers
  1. t/01-dh.........ok 15/18make: *** wait: No child processes.  Stop.           
  2. make: *** Waiting for unfinished jobs....
  3. make: *** wait: No child processes.  Stop.
  4.   /usr/bin/make test -- NOT OK
  5. Running make install
  6.   make test had returned bad status, won't install without force
  7. Running install for module Math::GMP
  8. Running make for C/CH/CHIPT/Math-GMP-2.04.tar.gz
  9. Checksum for /home/joao/.cpan/sources/authors/id/C/CH/CHIPT/Math-GMP-2.04.tar.gz ok
  10. Math-GMP-2.04/
  11. Math-GMP-2.04/Changes
  12. Math-GMP-2.04/COPYING.LIB
  13. Math-GMP-2.04/MANIFEST
  14. Math-GMP-2.04/typemap
  15. Math-GMP-2.04/GMP.xs
  16. Math-GMP-2.04/t/
  17. Math-GMP-2.04/t/gmppm.t
  18. Math-GMP-2.04/lib/
  19. Math-GMP-2.04/lib/Math/
  20. Math-GMP-2.04/lib/Math/GMP.pm
  21. Math-GMP-2.04/INSTALL
  22. Math-GMP-2.04/Makefile.PL
  23. Math-GMP-2.04/README
  24. Math-GMP-2.04/LICENSE
  25. Removing previously used /home/joao/.cpan/build/Math-GMP-2.04
  26.  
  27.   CPAN.pm: Going to build C/CH/CHIPT/Math-GMP-2.04.tar.gz
  28.  
  29. Checking if your kit is complete...
  30. Looks good
  31. Note (probably harmless): No library found for -lgmp
  32. Writing Makefile for Math::GMP
  33. cp lib/Math/GMP.pm blib/lib/Math/GMP.pm
  34. AutoSplitting blib/lib/Math/GMP.pm (blib/lib/auto/Math/GMP)
  35. /usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp  -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap typemap  GMP.xs > GMP.xsc && mv GMP.xsc GMP.c
  36. cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.04\" -DXS_VERSION=\"2.04\" -fPIC "-I/usr/lib/perl/5.8/CORE"   GMP.c
  37. GMP.xs:4:17: error: gmp.h: No such file or directory
  38. GMP.c: In function XS_Math__GMP_new_from_scalar:
  39. GMP.c:93: error: mpz_t undeclared (first use in this function)
  40. GMP.c:93: error: (Each undeclared identifier is reported only once
  41. GMP.c:93: error: for each function it appears in.)
  42. GMP.c:93: error: RETVAL undeclared (first use in this function)
  43. GMP.c: In function XS_Math__GMP_new_from_scalar_with_base:
  44. .
  45. .
  46. .
  47. GMP.c: In function XS_Math__GMP_gmp_fac:
  48. GMP.c:1024: error: mpz_t undeclared (first use in this function)
  49. GMP.c:1024: error: RETVAL undeclared (first use in this function)
  50. GMP.c: In function XS_Math__GMP_gmp_copy:
  51. GMP.c:1044: error: mpz_t undeclared (first use in this function)
  52. GMP.c:1044: error: m undeclared (first use in this function)
  53. GMP.c:1045: error: RETVAL undeclared (first use in this function)
  54. GMP.c:1103: error: expected expression before ) token
  55. make: *** [GMP.o] Error 1
  56.   /usr/bin/make  -- NOT OK
  57. Running make test
  58.   Can't test without successful make
  59. Running make install
  60.   make had returned bad status, install seems impossible
  61. Running make for D/DB/DBROBINS/Net-SSH-Perl-1.30.tar.gz
  62.   Is already unwrapped into directory /home/joao/.cpan/build/Net-SSH-Perl-1.30
  63.  
  64.   CPAN.pm: Going to build D/DB/DBROBINS/Net-SSH-Perl-1.30.tar.gz
  65.  
  66. cp lib/Net/SSH/Perl/Agent.pm blib/lib/Net/SSH/Perl/Agent.pm
  67. cp lib/Net/SSH/Perl/Auth/KeyboardInt.pm 
  68. .
  69. .
  70. .
  71. Manifying blib/man3/Net::SSH::Perl::Key::RSA.3pm
  72. Manifying blib/man3/Net::SSH::Perl::Packet.3pm
  73.   /usr/bin/make  -- OK
  74. Running make test
  75. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
  76. t/01-compile.....ok                                                          
  77. t/02-buffer......Can't locate Math/GMP.pm in @INC (@INC contains: /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/arch /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at t/02-buffer.t line 9.
  78. BEGIN failed--compilation aborted at t/02-buffer.t line 9.
  79. # Looks like your test died before it could output anything.
  80. t/02-buffer......dubious                                                     
  81.         Test returned status 255 (wstat 65280, 0xff00)
  82. DIED. FAILED tests 1-19
  83.         Failed 19/19 tests, 0.00% okay
  84. t/03-packet......Can't locate Math/GMP.pm in @INC (@INC contains: /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/arch /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/Util/SSH1MP.pm line 7.
  85. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/Util/SSH1MP.pm line 7.
  86. Compilation failed in require at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/Util.pm line 56.
  87. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/Key/RSA1.pm line 6.
  88. Compilation failed in require at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/SSH1.pm line 13.
  89. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl/SSH1.pm line 13.
  90. Compilation failed in require at /home/joao/.cpan/build/Net-SSH-Perl-1.30/blib/lib/Net/SSH/Perl.pm line 54.
  91. # Looks like your test died before it could output anything.
  92. t/03-packet......dubious                                                     
  93.         Test returned status 255 (wstat 65280, 0xff00)
  94. DIED. FAILED tests 1-10
  95.         Failed 10/10 tests, 0.00% okay
  96. t/04-config......ok                                                          
  97. t/05-cipher......ok                                                          
  98. t/06-circular....ok                                                          
  99. Failed Test   Stat Wstat Total Fail  Failed  List of Failed
  100. -------------------------------------------------------------------------------
  101. t/02-buffer.t  255 65280    19   38 200.00%  1-19
  102. t/03-packet.t  255 65280    10   20 200.00%  1-10
  103. Failed 2/6 test scripts, 66.67% okay. 29/116 subtests failed, 75.00% okay.
  104. make: *** [test_dynamic] Error 255
  105.   /usr/bin/make test -- NOT OK
  106. Running make install
  107.   make test had returned bad status, won't install without force
  108. Running make for D/DB/DBROBINS/Net-SFTP-0.10.tar.gz
  109.   Is already unwrapped into directory /home/joao/.cpan/build/Net-SFTP-0.10
  110.  
  111.   CPAN.pm: Going to build D/DB/DBROBINS/Net-SFTP-0.10.tar.gz
  112.  
  113. cp lib/Net/SFTP/Util.pm blib/lib/Net/SFTP/Util.pm
  114. cp lib/Net/SFTP.pm blib/lib/Net/SFTP.pm
  115. cp lib/Net/SFTP/Attributes.pm blib/lib/Net/SFTP/Attributes.pm
  116. cp lib/Net/SFTP/Buffer.pm blib/lib/Net/SFTP/Buffer.pm
  117. cp lib/Net/SFTP/Constants.pm blib/lib/Net/SFTP/Constants.pm
  118. Manifying blib/man3/Net::SFTP::Util.3pm
  119. Manifying blib/man3/Net::SFTP.3pm
  120. Manifying blib/man3/Net::SFTP::Attributes.3pm
  121. Manifying blib/man3/Net::SFTP::Buffer.3pm
  122. Manifying blib/man3/Net::SFTP::Constants.3pm
  123.   /usr/bin/make  -- OK
  124. Running make test
  125. PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
  126. t/01-load........Can't locate Net/SSH/Perl/Buffer.pm in @INC (@INC contains: /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib /home/joao/.cpan/build/Net-SFTP-0.10/blib/arch /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Buffer.pm line 6.
  127. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Buffer.pm line 6.
  128. Compilation failed in require at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Attributes.pm line 7.
  129. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Attributes.pm line 7.
  130. Compilation failed in require at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP.pm line 8.
  131. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP.pm line 8.
  132. Compilation failed in require at t/01-load.t line 5.
  133. BEGIN failed--compilation aborted at t/01-load.t line 5.
  134. t/01-load........dubious                                                     
  135.         Test returned status 2 (wstat 512, 0x200)
  136. DIED. FAILED test 1
  137.         Failed 1/1 tests, 0.00% okay
  138. t/06-circular....Can't locate Net/SSH/Perl/Buffer.pm in @INC (@INC contains: /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib /home/joao/.cpan/build/Net-SFTP-0.10/blib/arch /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Buffer.pm line 6.
  139. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Buffer.pm line 6.
  140. Compilation failed in require at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Attributes.pm line 7.
  141. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP/Attributes.pm line 7.
  142. Compilation failed in require at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP.pm line 8.
  143. BEGIN failed--compilation aborted at /home/joao/.cpan/build/Net-SFTP-0.10/blib/lib/Net/SFTP.pm line 8.
  144. Compilation failed in require at t/06-circular.t line 5.
  145. BEGIN failed--compilation aborted at t/06-circular.t line 5.
  146. t/06-circular....dubious                                                     
  147.         Test returned status 2 (wstat 512, 0x200)
  148. Failed Test     Stat Wstat Total Fail  Failed  List of Failed
  149. -------------------------------------------------------------------------------
  150. t/01-load.t        2   512     1    2 200.00%  1
  151. t/06-circular.t    2   512    ??   ??       %  ??
  152. Failed 2/2 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay.
  153. make: *** [test_dynamic] Error 2
  154.   /usr/bin/make test -- NOT OK
  155. Running make install
  156.   make test had returned bad status, won't install without force
  157. joao@joao-desktop:/usr/local/share/perl/5.8.8$ 
  158.  
Oct 30 '07 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
Because you have SOOO much text in your post, you are going to have to break it up over a couple of replies in order for it to display. Please do this if you can.

Regards,

Jeff
Oct 30 '07 #4

P: 63
Now I've tried to install the modules "manually".
I extracted the modules Net::SSH::PERL and NET::SFTP
then:
perl Makefile.PL
make
make test
make install

the make test give some erros in the both of them, but the make install runs fine.

when I run my script still have this error:

Expand|Select|Wrap|Line Numbers
  1. joao@joao-UBUNTU:~/files$ perl netftp
  2. Can't locate Math/Pari.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 6.
  3. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 6.
  4. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util.pm line 56.
  5. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP/Buffer.pm line 9.
  6. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SFTP/Attributes.pm line 7.
  7. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP/Attributes.pm line 7.
  8. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 8.
  9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 8.
  10. Compilation failed in require at netftp line 5.
  11. BEGIN failed--compilation aborted at netftp line 5.
  12. joao@joao-UBUNTU:~/files$ 
please, help me!!
Oct 30 '07 #5

numberwhun
Expert Mod 2.5K+
P: 3,503
Now I've tried to install the modules "manually".
I extracted the modules Net::SSH::PERL and NET::SFTP
then:
perl Makefile.PL
make
make test
make install

the make test give some erros in the both of them, but the make install runs fine.

when I run my script still have this error:

Expand|Select|Wrap|Line Numbers
  1. joao@joao-UBUNTU:~/files$ perl netftp
  2. Can't locate Math/Pari.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 6.
  3. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 6.
  4. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SSH/Perl/Util.pm line 56.
  5. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP/Buffer.pm line 9.
  6. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SFTP/Attributes.pm line 7.
  7. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP/Attributes.pm line 7.
  8. Compilation failed in require at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 8.
  9. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 8.
  10. Compilation failed in require at netftp line 5.
  11. BEGIN failed--compilation aborted at netftp line 5.
  12. joao@joao-UBUNTU:~/files$ 
please, help me!!
From this error:

Can't locate Math/Pari.pm in @INC

It looks like you are missing that module.

Regards,

Jeff
Oct 30 '07 #6

P: 63
Thansk jeff, I guess was really that the problem.
I Installed it, after that the Net::SSH::perl, and after that my Net::SFTP

Now it compiles without error the use of the module:

use Net::SFTP;
in my script.

But when I try to really use SFTP with this code:


Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use Net::SFTP;
  4.  
  5. my $host = 'sftp.tvnet.com.pt';
  6. my $user = 'estreias';
  7. my $pwd  = 'cinema';
  8.  
  9. print "breakpoint1\n";
  10.  
  11.  
  12.  my $sftp = Net::SFTP->new($host);
  13.  
  14.  
  15. print "breakpoint2\n";
  16.  
  17.  
  18. $sftp->put("sudo /home/joao/Desktop/AllCode.odt", AllCode.odt);
  19.  
  20. $sftp->quit;
  21.  
  22.  
I get this error:

Permission denied at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 62

The problem is that this is not in my code but in the files of the installation!
The error comes after breakpoint 1;

Can someone give me some light here?

thanks a lot,


Joo
Oct 30 '07 #7

numberwhun
Expert Mod 2.5K+
P: 3,503
Thansk jeff, I guess was really that the problem.
I Installed it, after that the Net::SSH::perl, and after that my Net::SFTP

Now it compiles without error the use of the module:

use Net::SFTP;
in my script.

But when I try to really use SFTP with this code:


Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use Net::SFTP;
  4.  
  5. my $host = 'sftp.tvnet.com.pt';
  6. my $user = 'estreias';
  7. my $pwd  = 'cinema';
  8.  
  9. print "breakpoint1\n";
  10.  
  11.  
  12.  my $sftp = Net::SFTP->new($host);
  13.  
  14.  
  15. print "breakpoint2\n";
  16.  
  17.  
  18. $sftp->put("sudo /home/joao/Desktop/AllCode.odt", AllCode.odt);
  19.  
  20. $sftp->quit;
  21.  
  22.  
I get this error:

Permission denied at /usr/local/share/perl/5.8.8/Net/SFTP.pm line 62

The problem is that this is not in my code but in the files of the installation!
The error comes after breakpoint 1;

Can someone give me some light here?

thanks a lot,


Joo
Just out of curiosity, when you installed the modules, did you do it as root or did you use "sudo"?

If you did it as root, then that could be your problem. Doing it as sudo runs the commands for installation with root permissions, but the difference is, you can still access the information.

Regards,

Jeff
Oct 30 '07 #8

P: 63
I had run it with sudo.
I'm not sure if is a problem in the installation or if I need to pass some more args in my code...
Right now I can't test this sftp with any server.,,
Oct 30 '07 #9

numberwhun
Expert Mod 2.5K+
P: 3,503
I had run it with sudo.
I'm not sure if is a problem in the installation or if I need to pass some more args in my code...
Right now I can't test this sftp with any server.,,
Since the process is SFTP, it leads me to ask if there is a login and pwd associated with the login to the remote server. If so, are they specified correctly? Just throwing out ideas is all.

Regards,

Jeff
Oct 30 '07 #10

P: 63
I use to use Filezilla to send files and I'm trying to use the same user, pwd, etc. I want to make a script to automate this process.

Do you think I can use SFTP in a regular FTP server? I'm not sure if the difference is only in "the way you send it" or is something else.

If I could, I could test my Net::SFTP.

thanks for your help,

Joo
Oct 30 '07 #11

P: 7
try using Net::SFTP::Foreign or Net::SSH2 instead
Nov 1 '07 #12

P: 63
thansk for your help guys, I already made it work.
I had to install every modules needed mannually!


hugs,

Joo
Nov 8 '07 #13

Post your reply

Sign in to post your reply or Sign up for a free account.