400 Bad Request安装Perlbrew本身

时间:2014-05-03 20:02:02

标签: linux bash curl perlbrew

我无法使用简单脚本安装Perlbrew:curl -L http://install.perlbrew.pl | bash

之前我很容易做到了,但是现在,在一个全新的CentOS 6.5中,我得到了一个400 Bad Request。

这是输出:

  % 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">'

如果我做卷曲部分(不将其传递给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>

这是我的卷曲版本: 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协议:tftp ftp telnet dict   ldap ldaps http file https ftps scp sftp

     

功能:GSS-协商IDN IPv6大文件NTLM SSL libz

常用编译器也随yum groupinstall 'Development Tools'

一起安装

什么可能失败?真的很奇怪......

1 个答案:

答案 0 :(得分:0)

http://install.perlbrew.pl链接实际指向https://raw.githubusercontent.com/gugod/App-perlbrew/master/perlbrew-install,这是一个bash脚本。我相信这个脚本中的curl命令是有问题的。

试试这个:将perlbrew-install bash脚本保存到你的机器上编辑curl行:

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

添加-k选项以禁用证书验证(请参阅curl insecure option)。注释掉周围的if / else语句,然后从命令行运行脚本。

或者,您可以尝试安装wget并从perlbrew.pl站点执行建议的命令:

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

相关问题