Cannot install perl module Apache2::Const in ubuntu - perl

I am having problem with installing perl module Apache2::Const.
When i am trying to install it using cpan.pm it shows the following error
Warning: Cannot install Apache2::Const, don't know what it is.
I am using Ubuntu 12.04, Apache/2.2.22 ,Perl 5.14.

Apache2::Const is part of mod_perl.
If you are using the ubuntu-provided apache, you probably just want to:
sudo apt-get install libapache2-mod-perl2

Looking at this website
http://ubuntuforums.org/archive/index.php/t-1747708.html
try:
apt-get install apache2-mpm-prefork

I just spent an hour on the exact same problem on Ubuntu 12.04, and finally figured it out. I had already installed libapache2-mod-perl2 :
$ sudo apt-get install libapache2-mod-perl2
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-perl2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Nonetheless, I kept getting the same error when I tried to install the Apache2::Const module via cpan:
$ cpan Apache2::Const
Going to read '/home/jdoe/.cpan/Metadata'
Database was generated on Sun, 27 Apr 2014 08:29:02 GMT
Warning: Cannot install Apache2::Const, don't know what it is.
Try the command
i /Apache2::Const/
to find objects with matching identifiers.
I finally figured out that Apache2::Const is already installed (in binary I suppose) when libapache2-mod-perl2 is installed:
$ perl -MApache2::Const < /dev/null
$
Therefore Apache2::Const is not supposed to be installed using cpan.

Related

Cwd.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)

All Perl modules and 'cpan' stopped working after an upgrade of Ubuntu 16.04 LTS to 18.04 LTS. Every time I run my script it leads to the error
threads.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)
when I try to open cpan it shows
Cwd.c: loadable library and Perl binaries are mismatched (got handshake key 0xdb00080, needed 0xde00080)
I had installed "Cwd", "threads" modules in ubuntu 16.04 where Perl version was 5.22.1, whereas in ubuntu 18.04 the Perl version is 5.26.1.
I tried to remove the old version of modules but failed. I deleted content on ~/.cpan folder.
PS:
Everything works fine in root user.
if I run
sudo su
cpan
works perfectly. But as a normal user, I cant run any perl modules/scripts/cpan.
How do I correct the issue?
How can I re-install cpan or cpan modules?
I tried to reinstall Perl which did not help
sudo apt-get --reinstall install perl
sudo apt-get --reinstall install libcwd-guard-perl
I installed cpan minus, cpan plus which gave the same error.
For solve problem next links can be used:
https://dev.to/foursixnine/about-perl-and-mismatched-binaries-346l
https://metacpan.org/pod/release/DBOOK/App-MigrateModules-0.002/script/perl-migrate-modules
Or in commands: (Replace to your perl5 folder, in my case it was ~/perl5)
mv <perl5> perl5_old
cpan
cpan App::MigrateModules
perl-migrate-modules --from perl5_old /usr/bin/perl
Where perl5 your perl folder, usually in path exists in ENV variable PERL5LIB.
I solved this issue by following https://github.com/Perl/perl5/issues/15861
I ran the command perl -MCPAN -e 'recompile()'
It recompile all the module, at last it worked.

Failed during install WWW::Curl::Easy in cpan

I am installing perl module "WWW::Curl::Easy" but it's getting error I also use by fource install but it's getting same error. why this is happend plz help me out.
I used these command in cpan
perl -MCPAN -e shell
force install WWW::Curl::Easy
cpan[1]> force install WWW::Curl::Easy
Reading '/root/.cpan/Metadata'
Database was generated on Thu, 16 Feb 2017 05:17:02 GMT
Running install for module 'WWW::Curl::Easy'
Checksum for /root/.cpan/sources/authors/id/S/SZ/SZBALINT/WWW-Curl-4.17.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
Configuring S/SZ/SZBALINT/WWW-Curl-4.17.tar.gz with Makefile.PL
Locating required external dependency bin:curl-config... missing.
Unresolvable missing external dependency.
Please install 'curl-config' seperately and try again.
NA: Unable to build distribution on this platform.
No 'Makefile' created SZBALINT/WWW-Curl-4.17.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
SZBALINT/WWW-Curl-4.17.tar.gz : writemakefile NO -- No 'Makefile' created
I use this and it's install "WWW::Curl::Easy" Module without any error
apt-get install libwww-curl-perl
On Red Hat try:
yum install curl curl-devel
installing only curl didn't work for me.
It is telling you the problem
Locating required external dependency bin:curl-config... missing.
Unresolvable missing external dependency. Please install 'curl-config'
seperately and try again.
So install curl-config and try again. Always check for dependencies.
Installing curl-config methods depends on the OS.
for Redhat for instance it will be
yum install curl
FreeBSD 12.2-RELEASE
cd /usr/ports/www/p5-WWW-Curl
make install clean
...
(cleaning for curl-7.80.0
cleaning for p5-WWW-Curl)

Linux: How to install DBD::Pg module?

Postgres DB is already installed. I'm not using system perl I have installed another perl in "/srv/data203806/Migration/CPAN/localperl/bin". When I'm trying to install, It is asking for PATH TO pg_config:
[root1#frmrszvwb023 bin]# ./cpan install DBD::Pg
Reading '/root/.cpan/Metadata'
Database was generated on Fri, 07 Mar 2014 03:53:02 GMT
Running install for module 'DBD::Pg'
Running make for T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Checksum for /root/.cpan/sources/authors/id/T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz ok
CPAN.pm: Building T/TU/TURNSTEP/DBD-Pg-3.0.0.tar.gz
Configuring DBD::Pg 3.0.0
Path to pg_config?
No POSTGRES_HOME defined, cannot find automatically
Warning: No success on command[/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL]
'YAML' not installed, will not store persistent state
TURNSTEP/DBD-Pg-3.0.0.tar.gz
/srv/data203806/MUXmh-Migration/CPAN/localperl/bin/perl Makefile.PL -- 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
Please help me to install DBD::Pg? How to get path to pg_config?
Just ran into this issue, and on Ubuntu 16.04 Xenial the package you're looking for is:
apt-get install libdbd-pg-perl
You have to install libpq-dev, e.g. on Ubuntu:
sudo apt-get install libpq-dev
On CentOS/RH you can fix it by installing perl-DBD-Pg package with yum
sudo yum install perl-DBD-Pg
From the README:
INSTALLATION:
Before installing, please use the "cpansign -v" program to
cryptographically verify that your copy of DBD::Pg is complete and
valid. The program "cpansign" is part of Module::Signature, available
from CPAN.
By default Makefile.PL uses App::Info to find the location of the
PostgreSQL library and include directories. However, if you want to
control it yourself, define the environment variables POSTGRES_INCLUDE
and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have
compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB
environment variable and add "-lssl" and "-lcrypto" to it, like this:
export POSTGRES_LIB="/usr/local/pgsql/lib -lssl -lcrypto"
The usual steps to install DBD::Pg:
perl Makefile.PL
make
make test
make install
Do steps 1 to 2 as a normal user, not as root!
If the script cannot find the pg_config information itself, it will
ask you for the path to it. Enter the complete path to the pg_config
file here, including the name of the file itself.
If you want to use a module, read the documentation.
Before installing perl module, you must install client for accessing Postgres DB. I just install server and header files:
sudo apt-get install postgresql
sudo apt-get install libpq-dev
You can try:
locate pg_config
This will show something like:
/usr/pgsql-10/bin/pg_config
/usr/pgsql-10/include/ecpg_config.h
/usr/pgsql-10/include/ecpg_config_x86_64.h
Then run:
POSTGRES_HOME=/usr/pgsql-10 ./cpan install DBD::Pg
UPD
If you still encounter issues with pg_config, you may need to add it to your PATH, e.g.:
export PATH=$PATH:/usr/pgsql-x.x/bin
where x.x is your version, such as /usr/pgsql-9.2./bin.
Fedora 29, plenv, perl v5.18.0
Once I got plenv working, I was able to install DBD::Pg with cpanm using these commands:
sudo dnf install postgresql postgresql-devel
cpanm --quiet --notest DBD::Pg
For ArchLinux (or any Distro using Pacman):
pacman -S perl-dbd-pg
For my Ubuntu 22 worked this:
sudo apt install build-essential
sudo apt install cpanminus
sudo apt-get install -y postgresql-server-dev-all
sudo cpanm DBD::Pg

How can I install XML::LibXML on Ubuntu

Here is the stdout for install:
$sudo cpanm XML::LibXML
--> Working on XML::LibXML
Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0014.tar.gz ... OK
Configuring XML-LibXML-2.0014 ... N/A
! Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.
details:
Unpacking XML-LibXML-2.0014.tar.gz
Entering XML-LibXML-2.0014
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.55_02)
Configuring XML-LibXML-2.0014
Running Makefile.PL
enable native perl UTF8
running xml2-config...ok (2.9.0)
Checking for ability to link against xml2...no
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
Try setting LIBS and INC values on the command line
Or get libxml2 from
http://xmlsoft.org/
If you install via RPMs, make sure you also install the -devel
RPMs, as this is where the headers (.h files) are.
Also, you may try to run perl Makefile.PL with the DEBUG=1 parameter
to see the exact reason why the detection of libxml2 installation
failed or why Makefile.PL was not able to compile a test program.
-> N/A
-> FAIL Configure failed for XML-LibXML-2.0014. See /home/kahmed/.cpanm/build.log for details.
i tried installing libxml2 manually, but still getting the same issue.
also, i checked for libxml2-dev:
sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libxml2-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.
here is the system info:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
uname -a
Linux autobot 2.6.38-8-server #42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
I think the relevant line is:
Checking for ability to link against libxml2...libxml2, zlib, and/or the Math library (-lm) have not been found.
So, you've covered off libxml. Have you installed the appropriate zlib package? Try:
sudo apt-get install zlib1g-dev
Then try installing XML::LibXML again.
Why do you want to use CPAN for this anyway? It is typically very bad idea to install CPAN packages if you have native packages provided by standard operating system installer.
Ubuntu provides a lot of Perl packages natively, with following naming convention: package name always starts with lib, then Perl package name like XML::LibXML is converted to lower case and :: replaced to dash - (XML::LibXML => xml-libxml), and finally -perl suffix is added. In other words, native package name for XML::LibXML would be libxml-libxml-perl.
So, in your case, you simply run this command and it will pull all necessary dependencies automatically:
sudo apt-get install libxml-libxml-perl
If you don't like this package for any reason you can uninstall it with sudo apt-get remove. If you use CPAN, it is very difficult to uninstall it reliably.
Overlooked the obvious:
sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev
then:
sudo cpanm XML::LibXML
works!
Maybe this is new version. I did:
sudo apt-get install libxml2-dev
After this module builded and installed successfully

Getting WebKit bindings to work with Perl and gkt2

I need to use WebKit in my perl + gtk2 application. Found a package Gtk2::WebKit on CPAN, but can't get it working.
cpan> install Gtk2::WebKit
gives following output:
Package webkit-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `webkit-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'webkit-1.0' found
at inc/Module/Install/PRIVATE/WebKit.pm line 24
*** can not find package webkit-1.0
*** check that it is properly installed and available in PKG_CONFIG_PATH
at inc/Module/Install/PRIVATE/WebKit.pm line 24
No 'Makefile' created'YAML' not installed, will not store persistent state
FLORA/Gtk2-WebKit-0.09.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
Failed during this command:
FLORA/Gtk2-WebKit-0.09.tar.gz : writemakefile NO -- No 'Makefile' created
It looks as if cpan wasn't able to find webkit, but I'm not sure how to fix that (my first time using perl and cpan).
Env: perl 5.12.4, ubuntu 11.10
Install libwebkitgtk-devel: sudo apt-get install libwebkitgtk-devel.
sudo apt-get install libwebkitgtk-dev
For Debian/Ubuntu and similar, the package name to install is libwebkitgtk-dev.
For OpenSuse and other RPM-based systems, the package name is libwebkitgtk-devel.