ubuntu 14.04 server perl POSIX install error - perl

I don't know perl, I just needed POSIX as a dependency for a script. I have configured cpan answering the default questions and then, inside cpan,
install POSIX
I have been asked a million questions, answered default to all, and now the script is installing a million modules. Do I really need this ? I'm concerned if something goes wrong is it possible to undo this easily ?
UPDATE
well, what I feared just happened
Everything is up to date. Type '/usr/bin/make test' to run test suite.
./perl -Ilib installperl --destdir=
/usr/local/bin is not writable by you
make: ** [install-all] Erro 2
RJBS/perl-5.22.0.tar.bz2
/usr/bin/make install -- NOT OK
Failed during this command:
RJBS/perl-5.22.0.tar.bz2 : install NO
please, how can I fix this ?

POSIX is a core module included with Perl. You don't need to install it separately. Why don't you just install Perl via your package manager instead of from source?

Related

Installing CPAN modules without root

I followed this helpful tutorial to get Perl installed just for my user. I am sorry to link to an external site but I think reading this is the only way to understand how to answer the question.
Anywho, I am feeding defaults to the CPAN config - the .cpan and CPAN directories created via the tutorial - yet for some reason CPAN still wants to dig into /usr/lib/ - which it just can't get to - when I try to install a module. This was while installing DBD::CSV.
Here is the error message:
All tests successful (7 subtests UNEXPECTEDLY SUCCEEDED), 3 tests skipped.
Files=23, Tests=706, 3 wallclock secs ( 2.28 cusr + 0.54 csys = 2.82 CPU)
/usr/bin/make test -- OK
Running make install
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/perl5lib/lib/Bundle/DBD'
mkdir /perl5lib: Permission denied at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 457
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1
make: *** [pure_site_install] Error 13
/usr/bin/make install -- NOT OK
It seems to be going to the wrong perl5lib.
Yeah, local::lib helps. I suggest using cpanm instead of cpan. I think it defaults to installing everything ~/perl5/lib/perl5. Here's a super useful tutorial.
local::lib causes installers to use INSTALL_BASE, which I consider broken. I use perlbrew to install a local copy of Perl instead.
You don't mess with your system's install of Perl, so you don't break your operating environment.
Allows you to have multiple versions and builds of Perl installed with no hassle.
INSTALL_BASE need not be used.
No need for special permissions.
take a look at this module: local::lib
did you configure the myconfig.pm inside cpan instead of letting it automatically fill in all the defaults? During the cpan configuration you needed to add PREFIX="" for the Makefile.PL portion so that it installs the modules to this new location where you have write access. Since its already configured automatically for you, go into .cpan/CPAN/, look for a MyConfig.pm and edit it. locate the line "makepl_arg" and change the value in [ ] to contain PREFIX="". Then try the perl -MCPAN -e shell and install a module.

installing perl module Class-Load-XS

I tried to install module Class-Load-XS-0.04 manually. I saw the following error:
$ perl Build.PL
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
However, the execution of perl -e 'use ExtUtils::CBuilder' was perfectly fine. I even tried to re-install ExtUtils::CBuilder, but it still does not work.
Could you please help?
I tried on my Win 7 machine, and it shows some warnings like this when I do perl Build.pl:
collect2: ld returned 1 exit status
Checking prerequisites...
requires:
! Class::Load is not installed
build_requires:
! Class::Load is not installed
! Module::Implementation is not installed
! Test::Fatal is not installed
! Test::Requires is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
Then I installed the above mentioned modules, and things went fine then.
You may try install these modules first.
Hope it helps.
It looks to me like you don't have a compiler. Try this:
perl -e 'use ExtUtils::CBuilder; $cb = ExtUtils::CBuilder->new; print $cb->have_compiler ? "have\n" : "dont have\n";'
Can I guess that you are on Windows using ActiveState Perl? If so perhaps try Strawberry Perl which comes with a compiler.
Had a similar problem installing a different module (Win32::Mutex). This isn't a great fix, but it got the job done. From the build directory (e.g., ~/.cpan/build/The-Module-mYyzLx)
First, set the CC environment variable yourself
SET CC=C:\strawberry\c\bin\g++.exe [Windows]
export CC=/usr/bin/g++.exe [Cygwin]
and try to build (perl Build.PL, perl Build, ...). If it is still complaining about missing programs (g++, dlltool, etc.):
Second, copy pieces of your tool chain into the build directory
COPY C:\strawberry\c\bin\g++.exe . [Windows]
COPY C:\strawberry\c\bin\dlltool.exe .
cp /usr/bin/g++ . [Cygwin]
cp /usr/bin/dlltool .
If the build still complains about missing programs, copy those to your build directory too.
The fix and the symptoms are consistent with ExtUtils::CBuilder not being able to use the current PATH setting, though I have no idea what that would be so difficult.
I'd suggest installing these first:
apt-get install libc6-dev
and
apt-get install libtest-exception-perl
By the way you describe the problem it looks like you have these two perl modules missing. On the other hand it takes just a couple of seconds to double-check if those are installed, but these 'seconds' could help you save on a lot of head ache.

Dependency problem of Perl CPAN modules

I tried to install SOAP::WSDL on Ubuntu 8.04 Server through CPAN but got the following error message:
cpan> install SOAP::WSDL
Running install for module SOAP::WSDL
Running make for M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz
Checksum for /root/.cpan/sources/authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz ok
SOAP-WSDL-2.00.10/
SOAP-WSDL-2.00.10/benchmark/
(skipped many lines)
SOAP-WSDL-2.00.10/README
CPAN.pm: Going to build M/MK/MKUTTER/SOAP-WSDL-2.00.10.tar.gz
# running Build.PL --installdirs site
Creating new 'MYMETA.yml' with configuration results
Creating new 'Build' script for 'SOAP-WSDL' version '2.00.10'
Prereq '0.0.5' for 'Class::Std::Fast' is not supported by Module::Build::Compat
Running make test
Make had some problems, maybe interrupted? Won't test
Running make install
Make had some problems, maybe interrupted? Won't install
I have the latest versions of Class::Std::Fast and Module::Build::Compat:
$ perl -MModule::Build::Compat -e 'print $Module::Build::Compat::VERSION;'
0.3607
$ perl -MClass::Std::Fast -e 'print $Class::Std::Fast::VERSION;'
0.0.8
Any idea how to solve the problem? Perhaps I need to downgrade Class::Std::Fast to version 0.0.5?
Long story short, it looks like your CPAN installation is preferring to use the compatibility Makefile.PL instead of the Build.PL. It should prefer the Build.PL. The Makefile.PLs were intended for compatibility only and may not have all the features of Module::Build, such as supporting three part versions.
Fire up cpan. o conf will let you see your configuration. If prefer_installer isn't set to MB then do o conf prefer_installer MB. You may have to o conf commit to save it (it will tell you). You may also have to install Module::Build, either from the libmodule-build-perl package or from CPAN.
Bug reported to SOAP::WSDL.
PS You can work around this by installing Class::Std::Fast first, download SOAP::WSDL manually, edit the Build.PL to remove that dependency, and run cpan . in SOAP::WSDL's directory to install it and its deps.
What is your CPAN version? And configuration? (o conf at the cpan shell prompt.)
Hmm, that all looks ok. Unless for some reason CPAN wasn't able to load Module::Build?
Can you try the install again from a fresh CPAN shell, with no previous commands?
Or try doing a manual install without using CPAN.pm?
Try it,
cpan Module::Build
and
cpan Module::Build::Compat
And I forget to say something, the Ubuntu modify the packages if you are trying to install modules with root user, forget. Try again with local::lib.
After you do it, do:
cpan install CPAN
and finally,
cpan upgrade
It should solve your problem.

Why can't I install DBD::mysql so I can use it with Maatkit?

I'm trying to install Maatkit following the maatkit instructions. I can't get past having to install DBD::mysql. "Warning: prerequisite DBD::mysql 1 not found."
When I try to install DBD::mysql from cpan, I get very helpful "make had returned bad status, install seems impossible".
Perl is "v5.8.8 built for darwin-thread-multi-2level", the one that came with OS X. I also tried building from source with same result.
We need more of the error message. Most likely, you are missing the MySQL client development files. I don't know how to install these on OSX. Also see this older post on OSX 10.5.2 , in which some other failures with the mysql client libraries are found.
Possibly post this question with more parts of your error message at perlmonks.org, if stackoverflow doesn't allow for convenient pasting of your make session or rather the last 20 or 10 lines of it.
Some more Googling with site:perlmonks.org also finds this post which has some more details on things to watch out for when installing DBD::MySQL. Depending on how comfortable you feel with the installation, you might want to manually run the tests, supplying a test database and test user or even skip testing the module.
After a bit more googling, this worked for me:
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
sudo ln -s /usr/local/mysql/include /usr/local/mysql/include/mysql
sudo perl -MCPAN -e 'install Bundle::DBD::mysql'
press enter a bunch of times, then in your maatkit folder:
perl Makefile.PL
sudo make install
and you'll find the mk-* programs in /usr/local/bin/
You will want to install MySQL first. I usually use the binary packages they provide for OS X. The packages do include the headers and MySQL client libraries which DBD::MySQL requires. Once the MySQL package is installed, DBD::MySQL should install without issue.
Here is my output:
$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite DBD::mysql 1 not found.
Writing Makefile for maatkit
$ mysql --version
mysql Ver 14.12 Distrib 5.0.51b, for apple-darwin9.0.0b5 (i686) using readline 5.0
I notice that there are in effect DBD::MySQL packages in the fink repositories. For example:
ayaz#ayazs-macbook$ fink list | grep -i 'dbd-mysql'
dbd-mysql-pm586 3.0008-10 Perl5 Database Interface to MySQL
dbd-mysql-pm588 3.0008-10 Perl5 Database Interface to MySQL
Perhaps installing through fink one of those packages may help alleviate your troubles.
Also, and I cannot be certain of this, you may want to install for MySQL-5.x (if you have that version installed) the mysql15-dev and mysql15-shlibs packages. I installed those through fink thus:
$ sudo fink --use-binary-dist install mysql15-dev

Make git-svn work on Slackware 12.1

It is obviosly some Perl extensions. Perl version is 5.8.8.
I found Error.pm, but now I'm looking for Core.pm.
While we're at it: how do you guys search for those modules. I tried Google, but that didn't help much. Thanks.
And finally, after I built everything, running:
./Build install
gives me:
Running make install-lib
/bin/ginstall -c -d /usr/lib/perl5/site_perl/5.8.8/i486-linux-thread-multi/Alien/SVN --prefix=/usr
/bin/ginstall: unrecognized option `--prefix=/usr'
Try `/bin/ginstall --help' for more information.
make: *** [install-fsmod-lib] Error 1
installing libs failed at inc/My/SVN/Builder.pm line 165.
Looks like Slackware's 'ginstall' really does not have that option. I think I'm going to Google a little bit now, to see how to get around this.
Base class package "Module::Build" is empty.
(Perhaps you need to 'use' the module which defines that package first.)
at inc/My/SVN/Builder.pm line 5
BEGIN failed--compilation aborted at inc/My/SVN/Builder.pm line 5.
Compilation failed in require at Build.PL line 6.
BEGIN failed--compilation aborted at Build.PL line 6.
is a (rather poor) way of asking you to install Module::Build.
Once you do that, it's
perl Build.PL
./Build
./Build test
./Build install
how do you guys search for those modules
http://search.cpan.org/
now I'm looking for Core.pm
That’s SVN::Core, which is a bit of a problem. Try installing Alien::SVN from CPAN. That worked for me on my freshly installed Slackware 12.0 on my laptop, but I have yet to get it to install on my workstation.
It should be compatible. The CPAN Tester's matrix shows no failures for Perl 5.8.8 on any platform.
Per the README, you can install it by doing:
perl Makefile.pl
make
make test
make install
I'm guessing you're running on Slackware so the cpan command is what you want to be using to install any Perl modules. It will pull in all dependencies for you. If you're running it for the first time it will have to do some cofiguration, but newer versions of cpan will ask if you want it to automatically configure it.
$ sudo cpan
cpan> install Alien::SVN
Additionally, if there's a package management application for Slackware, you should try that first to install new Perl modules.
https://metacpan.org/ is your first port of call for Perl modules.
What do you mean by "does not seem to be compatible"? Can you post the error message?
If the latest version does not work, you can select an older version in the "other releases" drop down and download that.
Edit: to those reading this, the author updated the question, so my answer seems a bit out of left field :)
The place to search is http://search.cpan.org.
I have my browser (Firefox) set up so that I can type "cpan foo" in the address bar and it will search CPAN for modules matching "foo." You can do this with either a keyword bookmark or by assigning a keyword to a search plugin.