-1

我无法使用简单的脚本安装 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">'

如果我执行 curl 部分,这就是响应(不将其传递给 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 文件 https ftps scp sftp

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

通常的编译器也安装了yum groupinstall 'Development Tools'

什么会失败?真的很奇怪……

4

1 回答 1

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 选项)。注释掉周围的 if/else 语句,然后从命令行运行脚本。

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

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

于 2014-05-05T19:39:29.957 回答