1

I'm attempting to install a new perl version with perlbrew:

perlbrew install perl-5.34.1

but this produces the error:

Fetching perl 5.34.1 as /home/703404669/perl5/perlbrew/dists/perl-5.34.1.tar.gz
Download https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.34.1.tar.gz to /home/703404669/perl5/perlbrew/dists/perl-5.34.1.tar.gz
ERROR: Failed to download https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.34.1.tar.gz
ERROR: Failed to execute the command

    curl --silent --location --fail -o /home/703404669/perl5/perlbrew/dists/perl-5.34.1.tar.gz https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.34.1.tar.gz

Reason:

    5888

which I'm unable to find on Google searches.

I know that there isn't any typo, because when I intentionally write something wrong, I get a different error.

I have no idea why this is happening, nor to fix it.

EDIT:

the command

curl --location https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.34.1.tar.gz > /dev/null

outputs

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 17.3M  100 17.3M    0     0  68.5M      0 --:--:-- --:--:-- --:--:-- 68.5M

How can I install a perl version with perlbrew?

con
  • 5,767
  • 8
  • 33
  • 62
  • What do you get if you try to `curl --location https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.34.1.tar.gz > /dev/null`? – choroba May 19 '22 at 15:45
  • @choroba I've edited the question to show the output to your command – con May 19 '22 at 15:48
  • Does this help? https://bytemeta.vip/repo/gugod/App-perlbrew/issues/709 – choroba May 19 '22 at 15:57
  • Exit code 5888 seems to be the same as exit code 23, according to [this](https://lists.samba.org/archive/rsync/2018-February/031498.html) post. Exit code 23 means *"Write error. Curl could not write data to a local filesystem or similar. curl receives data chunk by chunk from the network and it stores it like at (or writes it to stdout), one piece at a time. If that write action gets an error, this is the exit status."*, reference [here](https://everything.curl.dev/usingcurl/returns) – Håkon Hægland May 19 '22 at 15:59
  • 1
    I think you need to run `perlbrew init` first. Else the directories will be missing – Håkon Hægland May 19 '22 at 16:01
  • @HåkonHægland indeed, that is the solution! If you write your solution down, I'll accept your answer – con May 19 '22 at 16:02

2 Answers2

3

5888 is 0x1700. This could be $? for a program that used exit(0x17), which is to say exit(23). curl uses that exit code when

23 Write error. Curl couldn't write data to a local filesystem or similar.

Sounds like it can't write to /home/703404669/perl5/perlbrew/dists/perl-5.34.1.tar.gz.


If the directory doesn't exist, maybe you didn't properly install perlbrew.

Ways to install perlbrew:

\curl -L https://install.perlbrew.pl | bash
\wget -O - https://install.perlbrew.pl | bash
\fetch -o- https://install.perlbrew.pl | sh
sudo cpan App::perlbrew
perlbrew init

You also need to place a command in your shell's interactive startup script as instructed.


Or maybe you don't have enough disk space. Did you mean to install perlbrew somewhere other than /home/703404669/perl5/perlbrew?

The default perlbrew root directory is ~/perl5/perlbrew, which can be changed by setting PERLBREW_ROOT environment variable before the installation and initialization.

ikegami
  • 367,544
  • 15
  • 269
  • 518
  • the problem was a missing `perlbrew init` but none of the errors that I received indicated that explicitly. – con May 19 '22 at 16:22
  • `perlbrew init` isn't normally needed. [`\curl -L https://install.perlbrew.pl | bash` is the normal way to install the tool.](https://perlbrew.pl/), and `perlbrew init` is only needed when using `cpan` or similar to download the module. – ikegami May 19 '22 at 16:23
  • I had issues with that install command too, https://stackoverflow.com/questions/72306986/attempt-to-install-perlbrew-fails describes the problem and the solution – con May 19 '22 at 16:25
1

In my case the problem was that it would not create the destination folder for that download. So what fixed it for me was:
mkdir $HOME/perl5/perlbrew/dists -p

In the above case just:
mkdir -p /home/703404669/perl5/perlbrew/dists