0

I want to install XML::LibXML (among others) on a Linux machine with no internet and no root access.

My current solution is to download XML::LibXML and its dependencies from Windows, with strawberry perl, then install them on my linux machine. But I haven't find out how to do that.

Here's what I've tried:

First, I download XML::LibXML from Windows CPAN shell:

cpan[1]>get XML::LibXML

And it successfully downloads the package into:

C:\Users\mikedu95\.cpan\sources\authors\id\S\SH\SHLOMIF\XML-LibXML-2.0128.tar.gz

But not its dependencies. Indeed, now on Linux:

cpanm XML::LibXML --from /data/cpan/sources/

--> Working on XML::LibXML
Fetching file:///data/cpan/sources/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0128.tar.gz ... OK
Configuring XML-LibXML-2.0128 ... OK
==> Found dependencies: XML::SAX, XML::SAX::Exception, XML::NamespaceSupport, XML::SAX::Base
--> Working on XML::SAX
Fetching file:///data/cpan/sources/authors/id/G/GR/GRANTM/XML-SAX-0.99.tar.gz ... OK
Configuring XML-SAX-0.99 ... OK

We can see that XML::LibXML and its dependency XML::SAX are correctly found in my local mirror /data/cpan/sources/, because I have downloaded XML::SAX too.

However, the other dependencies are not found:

==> Found dependencies: XML::NamespaceSupport, XML::SAX::Base
--> Working on XML::NamespaceSupport
Fetching file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz ... FAIL
! Download file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz failed. Retrying ...
! Download file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz failed. Retrying ...
! Download file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz failed. Retrying ...
! Failed to download file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz
! Failed to fetch distribution XML-NamespaceSupport-1.11

Thanks.

mikedu95
  • 1,725
  • 2
  • 12
  • 24
  • 2
    Installing "pure Perl" modules on Strawberry Perl for Windows and copying the files over to Linux might work but probably not easily. But XML::LibXML is a wrapper around the libxml2 C library and the C wrapper code must be compiled for the right OS and the right version of Perl - so you can't just copy the .DLLs over to Linux. I'd really recommend talking to the person with root access and asking them to [install the OS package](http://grantm.github.io/perl-libxml-by-example/installation.html#installing-on-linux). – Grant McLean Aug 06 '16 at 04:48
  • You are trying to download a module from a local direction, ' file:///data/cpan/sources/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz failed` Try and install that one from the repos by itself, and then try again with LibXML. If you are re-using the Strawberry Perl installation, maybe that module was not installed for some reason. – jjmerelo Aug 10 '16 at 08:53

1 Answers1

2

Installing XML::LibXML is unlikely to be the last of your requirements, and I suggest that you use minicpan to create a local CPAN mirror which you can copy to your off-line system. You can then install anything you like from that mirror

Borodin
  • 126,100
  • 9
  • 70
  • 144
  • The installation for a particular module, XML::NamespaceSupport is failing. Having a local installation of CPAN is not going to help. – jjmerelo Aug 10 '16 at 08:51
  • @jjmerelo: The build of `XML::NamespaceSupport` fails at the start when cpan tries to fetch the targz. minicpan will certainly fix that. – Borodin Aug 10 '16 at 09:20
  • OK, I see your point. But if he's able to install minicpan, he will be able to install whatever he's looking for, right? The problem is that he's working on a system with no Internet and, additionally, no root access so he's got to make do with whatever is available. – jjmerelo Aug 10 '16 at 09:26
  • @jjmerelo: His system is off line. I'm suggesting that he uses an on line machine to create creates a minicpan database and copies it over to the off-line one, giving him access to all modules. You don't need root access to install a CPAN module. – Borodin Aug 10 '16 at 09:34