Getting "Proxy authentication Required" message while installing a perl module from CPAN - linux

I'm trying to install a Perl module (JSON) from CPAN but getting below error.
root#catspc:/etc/apt# cpan
cpan shell -- CPAN exploration and modules installation (v1.960001)
Enter 'h' for help.
cpan[1]> install JSON
Going to read '/root/.cpan/Metadata'
Database was generated on Sat, 07 Dec 2013 22:53:04 GMT
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz
Proxy authentication needed!
(Note: to permanently configure username and password run
o conf proxy_user your_username
o conf proxy_pass your_password
)
Username: vc06
Password:
Catching error: "Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.\cJ" at /usr/share/perl/5.14/CPAN.pm line 391
CPAN::shell() called at /usr/share/perl/5.14/App/Cpan.pm line 295
App::Cpan::_process_options('App::Cpan') called at /usr/share/perl/5.14/App/Cpan.pm line 364
App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
Fetching with LWP:
http://mirror.sov.uk.goscomb.net/CPAN/authors/01mailrc.txt.gz
Lockfile removed.
Undefined subroutine &CPAN::HTTP::Credentials::_clear_non_proxy_credentials called at /usr/share/perl/5.14/CPAN/HTTP/Credentials.pm line 10, <STDIN> line 2.
root#catspc:/etc/apt#
Could someone help me in fixing this issue? What went wrong here?
Awaiting your valuable reply.

Chances are your cpan configuration is skewed.
Is there a reason why you dont use cpanm? (https://metacpan.org/release/App-cpanminus)
I switched from cpan to cpanm some years ago and havent regretted it yet.
DESCRIPTION
cpanminus is a script to get, unpack, build and install modules from
CPAN and does nothing else.
It's dependency free (can bootstrap itself), requires zero
configuration, and stands alone. When running, it requires only 10MB
of RAM.

Related

Building Parsec dedup workload with parsecmgmt fails

I am trying to build Parsec_3.0 dedup workload on skylake server with gcc (Debian 6.3.0-18+deb9u1) 6.3.0. I managed to build streamcluster and canneal successfully without issues, however with dedup I get the error, when using same command: parsecmgmt -a build -p dedup
ERROR:
installing man1/smime.1
smime.pod around line 272: Expected text after =item, not a number
same with lines: 276, 280, 285, 289
POD document had syntax errors at /usr/bin/pod2man line 70.
make: *** [install_docs] Error 255
Makefile:680: recipe for target 'install_docs' failed
[PARSEC] Error: env PATH=/usr/bin:/home/akhorguani/parsec/parsec-3.0/bin:/usr/lo
cal/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/opt/dell/srvadmin/b
in:/usr/local/cuda/bin:/grid5000/code/bin:/home/akhorguani/parsec/parsec-3.0/bin
/usr/bin/make install failed.
In /usr/bin/pod2man line 70 is " print " $files[1]\n" if $verbose; ". But it's predefined file from the host machine so I don't think it would contain errors, most likely I might need to change something in parsec files.
So maybe anyone had faced the same problem and can help to fix it?
As jww mentioned, the error is due to some syntax errors on POD files from the SSL library that parsec uses. I had the same error and managed to build by replacing all instances of =item followed by a number with =item C<Number> in the POD files.
The files you need to modify are on the following folders:
$ folder-where-you-installed-parsec/pkgs/libs/ssl/src/doc/apps
$ folder-where-you-installed-parsec/pkgs/libs/ssl/src/doc/ssl
You can see the changes you need to do in this github gist.
I did the changes by hand but you can probably make a script that reads the files and fixes it for you.
I believe that the issue is platform specific because my colleague built it without any problems with Manjaro linux, while I'm using Ubuntu 18.04.
Eduardo's answer worked for me!
It seems the gist is out of date as ome of pod files have changed in the newer PARSEC version.
sed -i.bak 's/item \([0-9]\+\)/item C<\1>/g' *
The script above carries out needed transformation. Run it from apps and ssl folders

Cant install Net::SSH2 perl module

I'm trying to install a perl module: Net::SSH2 with cpan but doesn't actually works.
cpan -f install Net::SSH2
Output:
CPAN: Storable loaded ok (v2.20) Going to read
'/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Mon, 22 May 2017 22:29:03 GMT HTTP::Date
not available ............. New CPAN.pm version (v2.16) available.
[Currently running version is v1.9402] You might want to try
install CPAN
reload cpan to both upgrade CPAN.pm and run the new version without leaving the current session.
...............................................................DONE
Going to read '/root/.cpan/sources/modules/03modlist.data.gz' Can't
locate object method "data" via package "CPAN::Modulelist" (perhaps
you forgot to load "CPAN::Modulelist"?) at (eval 16) line 1. at
/usr/share/perl5/CPAN/Index.pm line 518
CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at
/usr/share/perl5/CPAN/Index.pm line 85
CPAN::Index::reload('CPAN::Index') called at /usr/share/perl5/CPAN.pm line 955
CPAN::exists('CPAN=HASH(0x21fd2f0)', 'CPAN::Module', 'install') called at /usr/share/perl5/CPAN/Shell.pm line 1243
CPAN::Shell::expandany('CPAN::Shell', 'install') called at /usr/share/perl5/CPAN/Shell.pm line 1639
CPAN::Shell::rematein('CPAN::Shell', 'force', 'install', 'install') called at /usr/share/perl5/CPAN/Shell.pm line 1935
CPAN::Shell::ANON('CPAN::Shell', 'install', 'install') called at /usr/bin/cpan line 318
main::_default('ARRAY(0x1938f18)') called at /usr/bin/cpan line 278
It seems that your installation of CPAN is incomplete or otherwise corrupted. OS and Perl version could be helpful. On many current Linux distributions, Perl modules and their dependencies can be installed using the normal system software utilities like yum (RHEL/CentOS), apt (Debian/Ubuntu) and yast (SuSE). Drawback is that versions may not be the most current.
This PerlMonks thread has someone else with a similar problem. It looks like this answer worked in that case:
It looks to me like you have some corrupt data in your .cpan directory. I'd blow it away and try again:
$ rm -rf /home/user/.cpan
Try it at your own risk. In your case, you would need to delete /root/.cpan.
In addition, the correct use of cpan is to list the module names after the command. So, instead of cpan install Net::SSH2, you should use cpan Net::SSH2. If you use the -f option, you must specify -i: cpan -f -i Net::SSH2, but try without forcing things first. You do not want to willy-nilly install broken modules in the system's perl.
In fact, in general, you do not want to mess with the system's perl at all. Build your own perl and mess with it as much as you want.
PS: install is a dummy module created precisely because many people make this mistake.
The safest and most convenient way to install Perl modules can depend on distribution. For example, the recommended method on Fedora is:
$ sudo dnf install 'perl(Net::SSH2)'
As shown in that example, installing Perl modules on your system usually requires sudo or the root user. So you might want to try your command with sudo if you're a sudoer.
If you don't have that kind of power, you may need to install it locally. That usually means downloading it to a Perl library directory you create in your home directory, and including the path in #INC somehow, such as updating your $PERL5LIB to include the /home/user/perl/modules/Net-SSH2/lib/ or whatever your path to the module lib directory is.

Python script import error `failed to map segment from shared object: Permission denied` with hplip

I have been installing locally the latest hplip 3.6.11 (HP Linux Imaging and Printing) for two computers that run on Ubuntu 14.04 LTS. The general installation procedure is described here. The whole procedure finished seamlessly for one machine but not for another one. I would like to pinpoint the cause of this failure and complete the installation.
Incident description
The step where one computer fails is when using hp-setup to configure the printer. hp-setup is a symbolic link to a Python script. On both machines, this file has the same attributes:
ll -Z $(realpath `which hp-setup`)
-rwxr-xr-x 1 root root ? 38026 Mar 1 08:10 /usr/share/hplip/setup.py*
In the failing computer, launching hp-setup throws an import error
Please make sure your printer is connected and powered on at this time.
Do you want to setup printer in GUI mode? (u=GUI mode*, i=Interactive mode) : i
Running 'hp-setup -i' command....
Traceback (most recent call last):
File "/usr/bin/hp-setup", line 48, in <module> from base import device, utils, tui, models, module, services, os_utils
File "/usr/share/hplip/base/device.py", line 42, in <module> from . import status
File "/usr/share/hplip/base/status.py", line 33, in <module> import cupsext
ImportError: libgpg-error.so.0: failed to map segment from shared object: Permission denied
error: hp-setup failed. Please run hp-setup manually.
Concerning cupsext (in the most recent call), in both computers the build directory of hplip contains ./hplip-3.16.11/prnt/cupsext/ that contains cupsext.h and cupsext.o. Conditions are equal here.
The requisite shared object lives in the same location /lib/x86_64-linux-gnu/libgpg-error.so.0.10.0 in both computers. The ll -Z shows same attributes and permissions, again.
Concerning the suggestion to run the script manually, it does not matter whether hp-setup is run by a script or manually. Actually, I get the same error if I launch one other script hp-plugin.
Also, the fact that installation script went this far means that all dependency and conflict issues have been ironed out.
This error is repeatable. If I remove the build/object directory manually and re-install from scratch, it occurs again. Note that the installation script itself has a rule to clean existing versions of hplip, including the one I had just installed with the same script.
With this evidence I searched possible causes of this error around the internet.
HPLIP diagnostics and troubleshooting tips
hp-check cannot only find what hp-setup has not accomplished, which is consistent. Then, the troubleshoot documentation does not seem to cover this error.
SELinux permission, security contexts and the like
This cause is suggested, for example, here and here.
I do acknowledge that SELinux issues are far beyond my experience and expertise.
However, the ll -Z command above shows that the SELinux tag ? is the same for same files in both computers. So the SELinux spoor does not quite isolate the issue.
Question
What can be the reason for a Python script
to throw an import error
to fail to map a segment from a so file
to encounter a permission denied
at the same time?
Disclaimer I has already lodged a question on this error in the past https://askubuntu.com/questions/743164/hplip-update-cannot-install-plugin, but I cannot quite recall which workaround or heavenly twist worked then. The description of this one incident is much more thorough since it isolates the problem within a scripting and library issue, which is independent of Ubuntu.

You have Archive::Tar 1.3901, but 1.50 or later is recommended. Please upgrade. issues

Hi i am trying to install bugzilla on my mediatemple server, i am totally a novice when i comes to cmmd line so have found a tutorial on-line which was going well till i tried to upgrade the above.
the below is the message i get in the command line and after looking on-line for about an hour i cant seem to find a resolution to the issue. basically i am stuck on where to go now to upgrade what its asking
Installing Archive::Tar version 1.76...
Running install for module 'Archive::Tar'
Running make for B/BI/BINGOS/Archive-Tar-1.76.tar.gz
CPAN: Digest::SHA loaded ok (v5.62)
CPAN: Compress::Zlib loaded ok (v1.42)
Checksum for /root/.cpan/source/authors/id/B/BI/BINGOS/Archive-Tar-1.76.tar.gz ok
CPAN: Archive::Tar loaded ok (v1.3901)
You have Archive::Tar 1.3901, but 1.50 or later is recommended. Please upgrade.
Uncompressed /root/.cpan/source/authors/id/B/BI/BINGOS/Archive-Tar-1.76.tar.gz successfully
Using Tar:/bin/tar xvf "Archive-Tar-1.76.tar":
Couldn't untar Archive-Tar-1.76.tar
CPAN: File::Temp loaded ok (v0.22)
CPAN: CPAN::Meta loaded ok (v2.110930001)
CPAN: Time::HiRes loaded ok (v1.9717)
Package seems to come without Makefile.PL.
(The test -f "/root/.cpan/build/BINGOS-J_TqCf/Makefile.PL" returned false.)
Writing one on our own (setting NAME to ArchiveTar)
Had problems unarchiving. Please build manually
Skipping test because of notest pragma
Running make install
Make had some problems, won't install
Manually install a new Archive::Tar version first. It looks like it's trying to use /bin/tar to untar the Archive::Tar package it downloaded, but failing to do so, perhaps because that's not the correct location of your tar binary.
Use which tar to find out where tar is on your system - it may be /usr/bin/tar, in which case, it's looking in the wrong place.
If you're using CPAN.pm for this, you can correct the path to tar with the following from the CPAN.pm shell (which you can get to with cpan or perl -MCPAN -e shell:
o conf tar '/usr/bin/tar'
o conf commit
(Using whatever path which tar gave you.)

CPAN giving all sorts of errors on ubuntu

I am just trying to run a simple perl program to import data from xml and export it to database.
Use Mysql; did not work, so I used DBD::mysql instead after failing to get Mysql.pm from cpan.
However, I am unable to install anything. I am trying to install xml parser module, but cpan gives these errors no matter what module you try to install.
install xml::parser
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
CPAN: Compress::Zlib loaded ok (v2.02)
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
CPAN: Time::HiRes loaded ok (v1.9719)
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
DONE
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
Catching error: "Can't locate object method \"data\" via package \"CPAN::Modulelist\" (perhaps you forgot to load \"CPAN::Modulelist\"?) at (eval 29) line 1.\cJ at /usr/share/perl/5.10/CPAN/Index.pm line 518\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 955\cJ\cICPAN::exists('CPAN=HASH(0xa225610)', 'CPAN::Module', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1243\cJ\cICPAN::Shell::expandany('CPAN::Shell', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1639\cJ\cICPAN::Shell::rematein('CPAN::Shell', 'install', 'xml::parser') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1935\cJ\cICPAN::Shell::__ANON__('CPAN::Shell', 'xml::parser') called at /usr/share/perl/5.10/CPAN.pm line 375\cJ\cIeval {...} called at /usr/share/perl/5.10/CPAN.pm line 372\cJ\cICPAN::shell() called at /usr/bin/cpan line 198\cJ" at /usr/share/perl/5.10/CPAN.pm line 391
CPAN::shell() called at /usr/bin/cpan line 198
Going to read '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Going to read '/root/.cpan/sources/modules/02packages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
cpanDONE
Going to read '/root/.cpan/sources/modules/03modlist.data.gz'
No history written (no histfile specified).
Lockfile removed.
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 31) line 1.
at /usr/share/perl/5.10/CPAN/Index.pm line 518
CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl/5.10/CPAN/Index.pm line 85
CPAN::Index::reload('CPAN::Index') called at /usr/share/perl/5.10/CPAN.pm line 692
CPAN::all_objects('CPAN=HASH(0xa225610)', 'CPAN::Distribution') called at /usr/share/perl/5.10/CPAN/Shell.pm line 1046
CPAN::Shell::failed('CPAN::Shell', 2, 1) called at /usr/share/perl/5.10/CPAN.pm line 413
eval {...} called at /usr/share/perl/5.10/CPAN.pm line 413
CPAN::shell() called at /usr/bin/cpan line 198
Am I doing something wrong? I tried searching for these errors, but no one has a right solution. Is there some setting in the config I should change?
If nobody has an answer for your particular problem I would probably just try with a new cpan, something like:
cd && mv .cpan .cpan-bak
and then trying to install the module again.
Hope this helps.
I had a similar problem.
Situation:
trying to install Catalyst::Plugin::AutoCRUD
using perl version: perlbrew-5.14.2
solution:
problem was the sudo i was prefacing to the cpan install command like this:
DIDNT WORK:
sudo cpan Catalyst::Plugin::AutoCRUD
WORKS:
chown -R myusername:myusergroup ~/.cpan
cpan Catalyst::Plugin::AutoCRUD
Reason: because i had perlbrew + cpan installed under my user account, NOT as root, all subsequent cpan module installs must be made with same user.
I had the same problem when my connection to the perl site timed out. The /root/.cpan/sources/modules/02packages.details.txt.gz contained only the information that the network timed out, and the /root/.cpan/sources/modules/03modlist.data.gz was also junk.
By removing just these files and trying again when the network was less busy, the files were then fetched correctly and everything worked fine again.
Check that your version of "cpan" (your installation program) matches your "perl" version...
Check this by doing: cpan --version and perl -v
I came across this same error while trying to install another module and it turned out that the version of "cpan" that I was using was compiled as part of the 5.8.8 perl package but the version of "perl" that is set as default here at work is version 5.8.5, so cpan was compiling the C code using references to the wrong 5.8.8 perl base library that was not compatible when implemented by the 5.8.5 perl base.
The simple solution was to call the proper "cpan" program using the full path "/usr/.../perl/5.8.5/bin/cpan module_name".
This little inconsistency of having different binaries of different version packages being default is a an oversight by our administrators and has really caused a lot of grief.
To resolve this issue I had to install cpanm on Centos7.
Steps:
yum install perl-devel
yum install perl-CPAN
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
Add local bin (/usr/local/bin) to PATH using:
PATH=$PATH:/usr/local/bin
Links
http://www.canfield.com/on-error-do/install-cpanminus-in-centos-6-aka-cpanm
http://www.cpan.org/modules/INSTALL.html
In my case, I needed to run cpan with sudo -H to get my local network setitngs (like proxies). So:
cd && mv .cpan .cpan-bak
Then:
sudo -H cpan
Default answered to cpan configs (this time the errors didn't appear).
Then I was able to install any module.

Resources