I'm running on RHEL6, with RHEL's perl-5.10.1-130.el6_4 installed. I am trying to build some RPMs using cpan2rpm 2.028. Also, perl-version-0.77-130.el6_4 is installed. It's giving odd failures, saying the installed version of Perl is not new enough:
$ perl -
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
...
$ cpan2rpm --no-sign ExtUtils::MakeMaker
-- cpan2rpm - Ver: 2.028 --
Upgrade check
Fetch: HTTP
-- module: ExtUtils::MakeMaker --
Using cached URL: http://search.cpan.org//CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.64.tar.gz
Tarball found - not fetching
Metadata retrieval
Tarball extraction: [/root/rpm/SOURCES/ExtUtils-MakeMaker-6.64.tar.gz]
Unable to build module, the following dependencies have failed:
perl >= 5.006
Stopped at /usr/bin/cpan2rpm line 491.
cannot remove path when cwd is /tmp/bj8upl6poj/ExtUtils-MakeMaker-6.64 for /tmp/bj8upl6poj: at /usr/share/perl5/File/Temp.pm line 902
-- Done --
What's causing cpan2rpm not to know what version of perl is installed?
I'm not sure why cpan2rpm doesn't work here. But I'll point out that the Red Hat team now use cpanspec to build all of their RPMs of CPAN modules. You might try that instead.
Unless there a reason you want to build the rpm with cpan2rpm, you can simply install the Perl modules from the yum repository. For example:
# yum install perl-ExtUtils-MakeMaker.x86_64
# rpm -q perl-ExtUtils-MakeMaker
perl-ExtUtils-MakeMaker-6.55-130.el6_4.x86_64
I had the same problem and it's fixed by installing Perldoc.
$ cpan Perldoc
Related
I was using Mac OS 12 and Perlbrew with Perl 5.36.
When I install GD using either CPAN or cpanm I get the following error:
cpanm (App::cpanminus) 1.7046 on perl 5.036000 built for darwin-2level
Work directory is /Users/mjb/.cpanm/work/1673722431.48328
You have make /usr/bin/make
You have LWP 6.67
You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
Searching install () on cpanmetadb ...
install is up to date. (0.01)
Searching GD () on cpanmetadb ...
--> Working on GD
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/GD-2.76.tar.gz
-> OK
Unpacking GD-2.76.tar.gz
Entering GD-2.76
Checking configure dependencies from META.json
Checking if you have ExtUtils::Constant 0.22 ... Yes (0.25)
Checking if you have ExtUtils::PkgConfig 0 ... Yes (1.16)
Configuring GD-2.76
Running Makefile.PL
Notice: Type perl Makefile.PL -h for command-line option summary.
Package gdlib was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdlib.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gdlib' found
at Makefile.PL line 530.
*** can not find package gdlib
*** check that it is properly installed and available in PKG_CONFIG_PATH
at Makefile.PL line 530.
-> N/A
-> FAIL Configure failed for GD-2.76. See /Users/mjb/.cpanm/work/1673722431.48328/build.log for details.
The above is the contents of build.log. I'm not sure how to investigate further or fix it.
Previously I had Perl's GD install and build using the system Perl. I also have libgd installed from Homebrew and I included /usr/local/lib in the env var PKG_CONFIG_PATH. Still no avail.
Would appreciate help as I rely upon GD for my personal projects. Thanks.
Found it... something (probably me botching my .zshrc) had unset my $PKG_CONFIG_PATH!
After finding out what pkg-config was and scouring my drive for any telling collection of .pc files, I found gdlib.pc under /usr/local/lib/pkgconfig/gdlib.pc.
Then I simply did an export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ and reran the installation. Perl's GD built and installed without grumbling.
A pernanment solution will be to add the above line to your ~/.zshrc.
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 am trying to install Net::SSH::Perl using cpanm (from perlbrew and perl version 5.30). The installation fails with:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758019.381709/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
The problem with installing Crypt::Curve25519 is described in this issue. I downloaded the problematic module Crypt::Curve25519 and patched it:
git clone git#github.com:ajgb/crypt-curve25519.git
wget https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
cd crypt-curve25519
git apply ../Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
perl Makefile.PL
make # No errors now
make test
make install
However, when I try again to install Crypt::Curve25519 it still tries to install the broken module from CPAN:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758833.382749/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
How can I make cpanm use the installed patch instead (i.e. skip installation of Crypt::Curve25519 since it is already installed)?
The problem seems to be missing VERSION information in the module. By adding a line
our $VERSION = 0.06;
to the top of the file lib/Crypt/Curve25519.pm and then reinstall, and then installing cpanm Net::SSH::Perl worked fine (it accepted the patched installation and did not try to download the broken version).
Here is the patch I used to lib/Crypt/Curve25519.pm:
diff --git a/lib/Crypt/Curve25519.pm b/lib/Crypt/Curve25519.pm
index 686b706..d9c2b3d 100644
--- a/lib/Crypt/Curve25519.pm
+++ b/lib/Crypt/Curve25519.pm
## -1,4 +1,5 ##
package Crypt::Curve25519;
+our $VERSION = 0.06;
#ABSTRACT: Generate shared secret using elliptic-curve Diffie-Hellman function
use strict;
There's a few things to check:
cpanm knows where to find your patched version.
The patched version has a version that's higher than the one on CPAN. The module idea in CPAN assumes that you always want the latest, so ensure that yours is.
You don't want to install a patched module at the standard location because you don't want a cpan client to overwrite it.
Some other things that can work:
Force install the module and ignore the failures (cpanm has a --notest feature). The CPAN version is still installed, but that doesn't matter.
Have your patched version in a separate directory that's at the front of #INC so your program finds it first. This effectively hides the CPAN version.
I am following the below procedure for installing LDAP in unix
1.tar -xzf perl-ldap-0.43.tar.gz
2.cd perl-ldap-0.43
3.perl MakeFile.PL
I am getting below message
* Checking for Perl dependencies...
We have to reconfigure CPAN.pm due to following uninitialized parameters:
cpan_home, keep_source_where, build_dir, build_cache, scan_cache, index_expire, gzip, tar, unzip, make, pager, makepl_arg, make_arg, make_install_arg, urllist, inhibit_startup_message, ftp_proxy, http_proxy, no_proxy, prerequisites_policy, cache_metadata
CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.
If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)
Are you ready for manual configuration? [yes]
How to install without CPAN and what are the dependent modules required to install Ldap?
Can anyone suggest me the standard process of installation.
Thanks In Advance
I assume that by perl-ldap-0.43.tar.gz you are trying to install Net::LDAP
How to install without CPAN?
CPAN is the recommended way of installing Perl modules. You have to configure it just once, after that if you need to install any Perl module you can just type the below.
$ cpan ModuleName like in your case instead of downloading, untaring and running makefile you can just do:
$ cpan Net::LDAP
What are the dependent modules required to install Ldap?
One more advantage of using CPAN is you don't have to care about dependencies. CPAN will install dependencies automatically if you ask it to do so. Do it by
$ perl -MCPAN -e shell
cpan[1]> o conf prerequisites_policy follow
cpan[2]> o conf commit
exit
Or just use App::cpanminus and run
$ cpanm Net::LDAP it will install the module with all its dependencies.
Also check out Perl LDAP page.
Edit: Based on your answer
You will get some errors like above, you will have to see the error log, check the Module which is missing, then go to CPAN and download that module's tar.gz and then do the same steps as you were doing, like untaring, and running Makefile. You will have to do this unless all of your dependencies are installed.
Can we ignore warnings while installing perl modules?
I have installed ExtUtils-MakeMaker-6.98.tar.gz by ignoring below warnings
Using included version of ExtUtils::Install (1.54) as it is newer than the installed version (1.33).
Using included version of CPAN::Meta::YAML (0.008) because it is not already installed.
Using included version of JSON::PP::Compat5006 (1.09) because it is not already installed.
Using included version of ExtUtils::Manifest (1.60) as it is newer than the installed version (1.46).
Using included version of version (0.88) because it is not already installed.
Using included version of ExtUtils::Command (1.16) as it is newer than the installed version (1.09).
Using included version of CPAN::Meta (2.120351) because it is not already installed.
Using included version of JSON::PP (2.27203) because it is not already installed.
Using included version of File::Temp (0.22) as it is newer than the installed version (0.16).
Using included version of Parse::CPAN::Meta (1.4405) because it is not already installed.
Using included version of File::Copy::Recursive (0.38) because it is not already installed.
Checking if your kit is complete...
Warning: the following files are missing in your kit:
't/liblist/win32/di
't/liblist/win32/space
Please inform the author.
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json**
But I'm able to install successfully. Will it create any problems in future?
when i try to install "GD" (perl -e shell -MCPAN ->(next step) cpan[1]> install GD) on Redhat 6.5 i got the error:
->
CPAN.pm: Building L/LD/LDS/GD-2.53.tar.gz
UNRECOVERABLE ERROR
Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.
Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site]
CPAN: YAML loaded ok (v0.90)
LDS/GD-2.53.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Running make test
Make had some problems, won't test
Running make install
Make had some problems, won't install
Could not read metadata file. Falling back to other methods to determine prerequisites
Failed during this command:
LDS/GD-2.53.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status 512
<-
I tryed to install "libgd 2.0.28 or higher" but don't find this in "yum".
locate libgd (shows):
/usr/lib64/libgd.so.2
/usr/lib64/libgd.so.2.0.0
Does anyone know an advice?
Many perl modules are available already built and packaged for RHEL and derivatives such as CentOS. In the case of perl-GD, it seems it is available in the CentOS in the base repo even though it is not in the RHEL repo.
However you can still use the Centos repo by adding it to your yum configuration. Create a file /etc/yum.repos.d/cantos.repo containing:
[centos]
name=CentOS $releasever - $basearch
baseurl=http://mirror.centos.org/centos-6/6/os/$basearch/
enabled=0
gpgcheck=0
After which you should be able to install perl-GD
yum install --enablerepo centos perl-GD
It looks as though the current version of perl-GD for centos is 2.44.
If you do need a newer version that that, you will either need to find a 3rd party yum repo which has the later version of libgd available, or compile it from source. In a quick google I could not find the former, so I would recommend you download the latest source package and install that.
You need the package gd-devel then rebuild the GD module.