i am trying to install perl package LWP::UserAgent using command "sudo perl -MCPAN -e shell; but it gives following error
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp4331'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
Fetching with LWP:
http://www.perl.org/CPAN/autho`rs/01mailrc.txt.gz
LWP failed with code[500] message[Can't connect to www.perl.org:80 (connect: No route to host)]
Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
"http://www.perl.org/CPAN/authors/01mailrc.txt.gz"
curl: (7) couldn't connect to host
Resolving ftp.perl.org... 204.157.3.70, 209.221.142.115
Connecting to ftp.perl.org|204.157.3.70|:21... failed: No route to host.
Connecting to ftp.perl.org|209.221.142.115|:21... failed: No route to host.
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp4331'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
No external ftp command available
Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist
push ftp://myurl/'
Your urllist is empty! The urllist can be edited. E.g. with 'o conf urllist
push ftp://myurl/'
Could not fetch authors/01mailrc.txt.gz
Terminal does not support GetHistory.
Lockfile removed.
Can't connect to www.perl.org:80
Looks like your system can not get a connection to the servers providing the software. Either you are offline, blocked by a firewall or you need to configure a proxy to reach the internet. This should affect any tools on the system, not just cpan. Note that any proxy settings you might have in your shell already do not get propagated to perl/cpan when you use sudo.
Related
Having problems when using the "sudo" command to make requests through a proxy server:
If i don't use sudo, the request goes through the proxy 10.139.212.25:8080
wget http://www.proxypronto com/
Connecting to 10.139.212.25:8080... connected.
Proxy request sent, awaiting response... 403 Forbidden (Blocked by Trustwave Secure Web Gateway)
2015-12-01 13:11:47 ERROR 403: Forbidden (Blocked by Trustwave Secure Web Gateway).
If I use sudo, the request does not go through the proxy 10.139.212.25:8080
sudo wget http://www.proxypronto com/
Resolving www.proxypronto com ... 96.31.64.186
Connecting to www.proxypronto com |96.31.64.186|:80... failed: Connection refused.
How can I make the requests to go through the proxy when using "sudo"?
Firstly, try the following comand:
sudo http_proxy=$http_proxy wget "http://stackoverflow.com"
At first glance, you need to add enviroment variables to sudoers config:
sudo visudo
add these lines
Defaults env_keep += "ftp_proxy http_proxy https_proxy no_proxy"
or, use separate lines:
Defaults env_keep +="http_proxy"
Defaults env_keep +="https_proxy"
Defaults env_keep +="HTTP_PROXY"
Defaults env_keep +="HTTPS_PROXY"
Following an equipment 'upgrade' at work, which is a Windows environment, I had to reinstall Perl. ActiveState never worked and I was able to install Strawberry, which fortunately comes with some necessary modules included, such as Excel parsers and writers. The problem is when I try to add additional needed modules. As I understand there are 2 ways to do this: Either download the tarball and build it manually or use cpan.
The first solution requires gmake which is disallowed/blocked by group policy
cpan also fails:
>cpan install Tk
Loading internal logger. Log::Log4perl recommended for better logging CPAN: LWP::UserAgent loaded ok (v6.52) Fetching with LWP: http://www.cpan.org/authors/01mailrc.txt.gz LWP failed with code[407] message[Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )]
Proxy authentication needed! (Note: to permanently configure username and password run o conf proxy_user your_username o conf proxy_pass your_password )
I also read somewhere that ppm build also works with strawberry, but I have been unable to find ppds.
Any suggestions?
I get the following error when connecting to a remote host to setup remote SSH connection.
Server did not start successfully. Full server log >>>
[09:58:46.599] > bash: line 212: /u/kasula/.vscode-server/bin/036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8/server.sh: No such file or directory
<<< End of server log
Not sure how to proceed, and no more information in the log file or terminal.
Please help.
I had the same issue too.
My local OS is macOS 10.15.4, and the remote OS is CentOS 8.
It turns out that CentOS 8 doesn't installed tar as default. So I just install it (sudo yum install tar), and then connect to remote again in VSCode and it works.
I have the same issue.
The server.sh file is nowhere to be found.
[18:10:19.668] > Server did not start successfully. Full server log >>>
> bash: line 302: /root/.vscode-server/bin/26076a4de974ead31f97692a0d32f90d735645c
> 0/**server.sh: No such file or directory**
> <<< End of server log
Update after solving the issue:
In my case, VSCODE couldn't download the server.sh file. I gave the linux server permission to download from these two sites and the problem was solved.
update.code.visualstudio.com or (https://visualstudio.com with all prefixes)
vo.msecnd.net or (https://msecnd.net with all prefixes)
i need to install perl-Mcrypt On CentOs6.5/32bit.
with cpan I get the following error:
[root#name ~]# cpan
cpan[1]>install Mcrypt
CPAN: Storable loaded ok (v2.20)
LWP not available
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp31072'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp31072'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
No external ftp command available
Client not fully configured, please proceed with configuring.
You have not configured a urllist and do not allow connections to the
internet to get a list of mirrors. If you wish to get a list of CPAN
mirrors to pick from, use this command
o conf init connect_to_internet_ok urllist
If you do not wish to get a list of mirrors and would prefer to set
your urllist manually, use just this command instead
o conf init urllist
LWP not available
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp31072'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
Warning: no success downloading '/root/.cpan/sources/authors/01mailrc.txt.gz.tmp31072'. Giving up on it. at /usr/share/perl5/CPAN/Index.pm line 225
No external ftp command available
How to fix it?
(also I dont Know How to Config Cpan)
Thanks.
Its might be a problem of proxy setting. set up http_proxy variable in cpan.
You can see here about configuration of web proxy (may be its not a right way but you can get some idea from here)
http://www.thesysadminhimself.com/2013/08/configuring-web-proxy-on-centos.html
My knowledge of perl is limited to running commands. I have managed to come up with a shell script to output the gav of a pom.xml, using xpath as follows:
xpath pom.xml '//project/artifactId/text()'
On a new machine right now, this does not work because I do not have the XPath.pm installed:
Can't locate XML/XPath.pm in #INC (#INC contains: /usr/lib/perl5/site_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.14 /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.14 /usr/lib/perl5/5.14/x86_64-cygwin-threads /usr/lib/perl5/5.14 .)
I seem to remember installing XPath using cpan so I tried the following command, blindly:
cpan XPath
This is probably not the correct command to use, but I think that is unrelated to the issue I am facing. The command gives following error:
Going to read '/home/****/.cpan/Metadata'
Database was generated on Mon, 25 Aug 2014 00:41:02 GMT
Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/authors/01mailrc.txt.gz
HTTP::Tiny failed with an internal error: Could not connect to 'proxy:8080': IO::Socket::INET: Bad hostname 'proxy' at /usr/lib/perl5/5.14/HTTP/Tiny.pm line 139
Proxy authentication needed!
(Note: to permanently configure username and password run
o conf proxy_user your_username
o conf proxy_pass your_password
)
Username: C-c C-c
Why is HTTP::Tiny looking for host proxy? We do have a corporate proxy with hostname proxy but that is needed only when I am on corporate network or VPN, neither of which is case right now.
How do I convince HTTP::Tiny to connect directly to internet? I do not have an envvar named http_proxy or HTTP_PROXY set.
While the environment variable is used, cpan first checks its configuration.
To view: o conf http_proxy
To clear: o conf http_proxy ''
Don't forget to use o conf commit to make the change permanent.
CPAN uses HTTP:Tiny to download info about the module you are asking for. It is lightweight so it runs fast.
Either CPAN has not been configured, or the cpan found on your path is configured to use the proxy. Determine the location of the CPAN program you are executing and proceed from there.
This msg Can't locate XML/XPath.pm in #INC (#INC contains: /usr/lib/perl5/site_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/site_perl/5.14 /usr/lib/perl5/vendor_perl/5.14/x86_64-cygwin-threads /usr/lib/perl5/vendor_perl/5.14 /usr/lib/perl5/5.14/x86_64-cygwin-threads /usr/lib/perl5/5.14 .) shows that module is not installed.
If you are on windows and using a proxy setting. You can use these commands to install module from ppm or cpan. Open a command prompt and run these commands :
set http_proxy=http://xxx.xxx.xxx.x:yyyy (xxx is your system proxy and yyyy is port)
set http_proxy_user=username (login username)
set http_proxy_pass=password (login password)
To install a module from cpan type:
cpan install modulename
The error occurs because you have set http_proxy variable to direct IP, Instead, put http_proxy=http://ipaddress , then it will work