3

I have a Linux server, and it has its own Perl whose version is not what I want. So I want to install another Perl on it.

I tried to solve it with Perlbrew, but my server can't download it. It seems like my server does not trust that website address. And I don't know whether I should download it as root. Besides, I think there is a huge difference between root and a normal user to download and install it, and I just want do it as a normal user.

Is there another way install different version Perl on my server? I downloaded the version I want before, and I tried to install it in a usual way, but it just failed.

Here is the wrong when I tap the command

wget -O - https://install.perlbrew.pl | bash as a normal user.enter image description here

Maybe I should tap it as root? And when I try to install the Perl v5.8.8(this is version I want) in ~/bin,i run the Configure.

But I can not run make after that, it just told me that make:No rule to make target , needed by miniperlmain.o Stop. Besides,

my Linux is Centos 7.4. I don`t how to fix it.

It seems that I find a way to let me to make. Here is the link. After I edit the makedepend.SH, I run make again. But I got this wrong: enter image description here

The thing is really weird. Why Perl V5.8.8 is so difficult to install.

ophychius
  • 2,623
  • 2
  • 27
  • 49
Zeason
  • 31
  • 2
  • 1
    I would, as the `root` user, install the OS package for `perlbrew` , and then, as the normal user, install the appropriate (version of) Perl. How does downloading and installing perlbrew fail for you? Please [edit] your question and add your Linux version, the command you're trying and the output how it fails. – Corion Dec 11 '18 at 15:45
  • You could have a look at https://github.com/tokuhirom/plenv – oalders Dec 11 '18 at 16:16
  • *"It seems like my server does not trust that website address"* It would be helpful to know what led you to that conclusion. What error messages did you see? – Dave Cross Dec 11 '18 at 19:26
  • I just edit the question again, this maybe more clear to you guys. – Zeason Dec 12 '18 at 02:51

1 Answers1

1

The easy answer is 'just install perl' - it'll drop by default into /usr/local/bin, and you can just use that instead.

DON'T overwrite /usr/bin/perl, as that's a recipe for pain. (Lots of stuff will have dependencies on perl versions installed via your package manager).

Sobrique
  • 52,974
  • 7
  • 60
  • 101
  • You can use [perl-build](https://metacpan.org/pod/perl-build) which can be downloaded as a standalone script to install a Perl wherever you want. I often install to `/opt/perl`, then add `/opt/perl/bin` to my PATH and then that perl is used for everything I do. – Grinnz Dec 11 '18 at 21:29
  • i try to use perl-bulid. But i still cant download it. The wrong is just like the picture i show you above. :( – Zeason Dec 12 '18 at 02:28
  • Grab the source off cpan, run `./Configure -de && make && make test && make install`. Seems to work usually... – Sobrique Dec 12 '18 at 13:13
  • I try the way you told me.But when i run make , i got this: collect2: error: ld returned 1 exit status make: *** [miniperl] Error 1. Besides , can the script i edit under a old version perl run well under my new version perl? If it can , i dont need to install perl 5.8.8 any longer. – Zeason Dec 13 '18 at 00:48