-2

I ran this command to install mojolicious and I got the command below. Not sure how to solve it, please help.

~$ sudo curl -L https://cpanmin.us | perl - -M https://cpan.metacpan.org -n Mojolicious


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  297k  100  297k    0     0  98815      0  0:00:03  0:00:03 --:--:-- 98825
!
! Can't write to /usr/local/share/perl/5.18.2 and /usr/local/bin: Installing modules to /home/foneworx/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /usr/local/share/perl/5.18.2 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
Chankey Pathak
  • 21,187
  • 12
  • 85
  • 133
user957129
  • 43
  • 1
  • 2
  • Sorry I meant I got the error below not command – user957129 Sep 14 '16 at 07:52
  • 2
    Can you be more specific about where you are stuck? That warning gives three choices for resolving the issue it is warning about. Have you tried any or all of those? If so, what happened? – mp3 Sep 14 '16 at 08:56
  • You can [edit] your question by using the [edit] link under the question on the left, below the tags. Or you can click the [edit] that I supplied here. – simbabque Sep 14 '16 at 12:00

1 Answers1

2

You sudo your file download (completely useless), but don't sudo Perl. Perl is the command you need to elevate to grant write permissions to the system.

The correct command-line is:

curl -L https://cpanmin.us | sudo perl - -M https://cpan.metacpan.org -n Mojolicious

Or you could just use the regular CPAN interface (I'm not familiar with cpanminus):

sudo perl -MCPAN -e 'install Mojolicious'
oals
  • 210
  • 2
  • 9
  • `sudo cpan Mojolicious` should work and it comes with Perl. With your first command, once you install cpanm, you don't need to use the `curl` anymore. – brian d foy May 21 '22 at 16:01