Question

I can't install Perlbrew using the easy script: curl -L http://install.perlbrew.pl | bash

I did it before, easily, but now, in a brand new CentOS 6.5, I get a 400 Bad Request.

This is the output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
113   226  113   226    0     0    187      0  0:00:01  0:00:01 --:--:--   187
bash: line 1: syntax error near unexpected token `newline'
bash: line 1: `<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'

And this is the response if I do the curl part (without passing it to bash)

curl -L http://install.perlbrew.pl

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
  <head>
    <title>400 Bad Request</title>
  </head>
  <body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    </p>
  </body>
</html>

This is my Curl version: curl -V

curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp

Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Usual compilers are also installed with yum groupinstall 'Development Tools'

What can be failing? It is really strange...

Was it helpful?

Solution

The http://install.perlbrew.pl link actually points to https://raw.githubusercontent.com/gugod/App-perlbrew/master/perlbrew-install, which is a bash script. I believe that the curl command in this script is the one having the problem.

Try this: Save the perlbrew-install bash script to your machine edit the curl line:

PERLBREWDOWNLOAD="curl -f -sS -Lo $LOCALINSTALLER $PERLBREWURL"

by adding the -k option to disable cert validation (See curl insecure option). Comment out the surrounding if/else statements and then run the script from your command line.

Alternatively, you could try installing wget and do the suggested command from the perlbrew.pl site:

wget -O - http://install.perlbrew.pl | bash

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top