End goal is to install Excel::Writer::XLSX on a server without internet access.
I want to install SUPER as its a prerequisite. Sub::Identify is a prerequisite of SUPER. I believe I installed Sub:Identify successfully. But when I attempt to install SUPER I am prompted that the prerequisite is not installed. Here are the commands I entered on command prompt and the output:
cd Sub-Identify-0.14
perl MakeFile.pl
perldoc -l Sub::Identify
Output: lib\Sub\Identify.pm\
cd SUPER-1.20141117
perl Build.PL
Output: Sub::Identify is not installed
perl Makefile.PL
Output: Warning: prerequisite Sub::Identify 0 not found.
You didn't install Sub::Identify.
tar zvzf Sub-Identify-0.14.tar.gz
cd Sub-Identify-0.14
perl MakeFile.pl
make test # missing
make install # missing
cd ..
tar zvzf SUPER-1.20141117.tar.gz
cd SUPER-1.20141117
perl Build.PL
./Build.PL test
./Build.PL install
cd ..
By the way, you could create a mirror of CPAN using CPAN::Mini. If you copy this mirror to your offline machine, you could use cpan to install modules despite not being online.
Related
I'm new to perl, but, I'm just trying to install it on my windows 10 machine, because, I need to use a NAGIOS plugin named check_logfiles. A perl script/app.
while I am installing Strawberry Perl, I need additional Modules. I invoked CPAN to install more modules and it fails because it finds the GIT Perl CPAN.
how ( can I ) can Perl be installed and this Perl installation is selected instead of the GIT perl? I don't know if I can de-install GIT's Perl ?
ERROR
Trying with
/c/bin/wget.EXE -O "/c/Users/212555427/.cpan/sources/authors/01mailrc.txt.gz.tmp7712"
to get
http://www.cpan.org/authors/01mailrc.txt.gz
--14:42:06-- http://www.cpan.org/authors/01mailrc.txt.gz
=> `C:/Users/212555427/.cpan/sources/authors/01mailrc.txt.gz.tmp7712'
Resolving www.cpan.org... failed: Host not found.
This /c/Users/212555427/.cpan is the GIT installation
I install Strawberry Perl under default C:\Strawberry
$ which perl
/usr/bin/perl
$ where perl
C:\Strawberry\perl\bin\perl.exe
C:\Program Files\Git\usr\bin\perl.exe
$ where cpan
C:\Strawberry\perl\bin\cpan
C:\Strawberry\perl\bin\cpan.bat
C:\Program Files\Git\usr\bin\core_perl\cpan
$ cpan Date::Manip.pm
WARNING: your version of App::Cpan is 1.63_01 while we would expect at least 1.64 at /c/Strawberry/perl/bin/cpan line 11.
Loading internal null logger. Install Log::Log4perl for logging messages
Fetching with LWP:
http://www.cpan.org/authors/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.cpan.org:80]
Trying with
/c/bin/wget.EXE -O "/c/Users/212555427/.cpan/sources/authors/01mailrc.txt.gz.tmp22892"
to get
http://www.cpan.org/authors/01mailrc.txt.gz
thank you - please let me know if I need to provide anything else to resolve issue.
I'm trying to figure out why I can't get the GD perl module to install on my Debian 7 server. Here is how I installed the core stuff:
sudo apt-get install libgd-gd2-perl
Then running the -MCPAN to install, I get:
root#myserver:~# sudo perl -MCPAN -e 'install GD'
Going to read '/root/.cpan/Metadata'
Database was generated on Sun, 19 Jul 2015 21:41:02 GMT
Running install for module 'GD'
Running make for L/LD/LDS/GD-2.56.tar.gz
Checksum for /root/.cpan/sources/authors/id/L/LD/LDS/GD-2.56.tar.gz ok
CPAN.pm: Going to build L/LD/LDS/GD-2.56.tar.gz
Configuring for libgd version 2.0.36.
Checking for stray libgd header files...none found.
Unknown option: installdirs
Usage: perl Build.PL [options]
Configure GD module.
Options:
-options "JPEG,FT,PNG,GIF,XPM,ANIMGIF" feature options, separated by commas
-lib_gd_path path path to libgd
-lib_ft_path path path to Freetype library
-lib_png_path path path to libpng
-lib_jpeg_path path path to libjpeg
-lib_xpm_path path path to libxpm
-lib_zlib_path path path to libpng
-ignore_missing_gd Ignore missing or old libgd installations and try to compile anyway
If no options are passed on the command line. The program will
attempt to autoconfigure itself with the gdlib-config program (present
in GD versions 2.0.27 or later). Otherwise it will prompt for these
values interactively.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]
LDS/GD-2.56.tar.gz
/usr/bin/perl Build.PL --installdirs site -- NOT OK
Running Build test
Make had some problems, won't test
Running Build install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
I've done a load of googling, but nothing seems to fix it. Any suggestions?
The error you are getting is
Unknown option: installdirs
Usage: perl Build.PL [options]
cpan expects Build.PL to pass its arguments to Module::Build, but GD has a funky Build.PL. Let's "fix" it.
Execute the following from a temporary directory:
wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
-or-
curl -L http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz >GD-2.56.tar.gz
tar xvzf GD-2.56.tar.gz
cd GD-2.56
perl -i~ -pE'say "Getopt::Long::Configure(qw( pass_through ));" if /GetOptions/;' Build.PL
/usr/bin/perl Build.PL --installdirs site
sudo ./Build.PL installdeps
./Build.PL make
./Build.PL test
sudo ./Build.PL install
In Ubuntu 15.04, a slight modification of the above intelligent answer seemed necessary in order to get it to install GD. This worked so that the 'cpan' program could then install GD then e.g. Image::Resize (which uses GD) afterwards. I did it after
sudo -i
in a Terminal, and after 'cd' into a temporary folder. Whether of value or not, I first did
apt-get install libgd-dev
Then this, which may contain one or more redundant lines, but it works:
wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
tar xvzf GD-2.56.tar.gz
cd GD*
perl -i~ -pE'say "Getopt::Long::Configure(qw( pass_through ));" if /GetOptions/;' Build.PL
/usr/bin/perl Build.PL --installdirs site
chmod 755 Build.PL
./Build.PL installdeps
./Build installdeps
./Build test
./Build install
I've found myself on CentOS without root access, and with a very lame Perl that doesn't even have ExtUtils::MakeMaker.
Does there exist something that could produce an archive of a module's dependencies, for my to unwrap into a directory that I could put into #INC?
use App::cpanminus
cd ~/bin
curl -LO http://xrl.us/cpanm
chmod +x cpanm
export ROOT=/some/directory
export PERL5LIB=${ROOT}/lib/perl5
Then, install ExtUtils::MakeMaker and Module::CoreList. You can't do a simple installation because these modules are used by cpanm, and it doesn't look in the unpacked source directory for them. So, get cpanm to download them, and do a semi-manual install. It actually installs three distributions (the above two and ExtUtils::Install), which is why you get to invoke the build mantra three times:
PERL_MM_OPT=INSTALLBASE=$ROOT ./cpanm -L $ROOT --look ExtUtils::MakeMaker Module::CoreList
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit
It unpacks and cds into each distribution's directory successively. At least that's what happens on a bare-bones CentOS 6 install I just happen to have lying around.
After that, you should be able to install your module and its dependencies via
./cpanm -L $ROOT <module name, or url, or tarball goes here>
Look at the cpanm docs for more info.
You could use perlbrew to innstall a full new Perl with user access.
http://perlbrew.pl/
#install perlbrew
wget -O - http://install.perlbrew.pl | bash
# install new perl for youurself
perlbrew install perl-5.16.0
# set aliases
perlbrew switch perl-5.16.0
#reinstall all moodules for new perl http://perlbrew.pl/Reinstall-All-Modules-On-New-Perl.html
perlbrew list-modules | perlbrew exec --with perl-5.16.0 cpanm
#how to install/recompile third party modules
https://github.com/lecstor/DevNotes/wiki/Image-Magick-with-Perlbrew
Regards,
Download and untar ExtUtils::MakeMaker, create a directory lib under your home directory, install via:
perl Makefile.PL PREFIX=~/lib LIB=~/lib
Now that module is installed I suggest you use local::lib (easy install via the bootstrap method in the documentation) to install modules:
perl -MCPAN -Mlocal::lib -e 'CPAN::install(MIME::Lite)' # Replace MIME::Lite with what you want to install.
Here MIME::Lite gets installed via cpan to your local lib directory.
Prelbrew won't take long to set up, and you likely have an easier time of things in the long run.
Edit, too long for comment.
#LeeGee Perhaps I wasn't specific enough.
The method described will allow you to get around the restricted version of perl you have access to, and allow installaton of modules to another location.
If you want to package your app on another machine you could use either PAR or pp to create a standalone package of code & modules, or a stand alone executable.
Failing that Module::ScanDeps will find a scripts dependencies
My scripts require a new version of perl, which I have installed into a local directory, to avoid corrupting the packaged version of perl that comes with Debian.
I configured and installed a tarball of perl with:
Configure -des -Dprefix=/root/perl
make
make install
Then I called cpan with:
/root/perl/bin/perl -MCPAN -e shell
Every time I install a module I do this:
$/root/perl/bin/perl -MCPAN -e shell
cpan[2]> install Getopt::Long
cpan[2]> install WWW::Mechanize
cpan[2]> install File::Find::Rule
With a system version of perl I used to be able to do this from Bash:
$cpan -i DBI
How can I use a similiar command from bash, without needing to open up the cpan shell each time I need to install a module?
Edit: I should have read the documentation more thoroughly.
The solution is:
/root/perl/bin/perl -MCPAN -e 'install Getopt::Long'
Or (Thanks, suddenmoves)
/root/perl/bin/cpan -i Getopt::Long
If you've got a full install of perl under /root/perl, is there not a /root/perl/bin/cpan executable you can run?
When ever I try to cpanp install Text::Markdown::Discount on Strawberry Perl I get
cp lib/Text/Markdown/Discount.pm blib\lib\Text\Markdown\Discount.pm
( cd discount-2.1.2; CC='cc -fPIC' sh configure.sh; make )
The system cannot find the path specified.
I see a lot of others are having this same problem. Can T:M:D be installed on Strawberry Perl?
You also can not install T:M:D with ppm:
PPM> install Text::Markdown::Discount
Install package 'Text-Markdown-Discount?' (y/N): y
Installing package 'Text-Markdown-Discount'...
Error installing package 'Text-Markdown-Discount': Could not locate a PPD file f
or package Text-Markdown-Discount
I installed Text::Markdown::Discount with these steps:
git clone https://github.com/sekimura/text-markdown-discount.git
cd text-markdown-discount/
perl Makefile.PL
make
make test
sudo make install