2

I am new to Ubuntu, and for some reason I cannot install any Perl modules. This is my first module install attempt, I believe, fix this and it fixes the rest. hopefully!

$ cpanm AnyEvent

 Can't write to /usr/local/share/perl/5.26.1 and /usr/local/bin: Installing modules to /home/cougar/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.26.1 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)

--> Working on AnyEvent
Fetching http://www.cpan.org/authors/id/M/ML/MLEHMANN/AnyEvent-7.15.tar.gz ... OK
==> Found dependencies: Canary::Stability
--> Working on Canary::Stability
Fetching http://www.cpan.org/authors/id/M/ML/MLEHMANN/Canary-Stability-2013.tar.gz ... OK
Configuring Canary-Stability-2013 ... OK
Can't configure the distribution. You probably need to have 'make'. See /home/cougar/.cpanm/work/1559943124.9523/build.log for details.
Installing the dependencies failed: Module 'Canary::Stability' is not installed
Bailing out the installation for AnyEvent-7.15.

Please help!

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
Cougar
  • 119
  • 1
    Any particular reason you are trying to install from CPAN - rather than using the available Ubuntu package (libanyevent-perl)? – steeldriver Jun 07 '19 at 22:12
  • Yes, it is what is needed to run a perl script program, I need certain modules installed and that is the first one. Strange, they installed easier on windows than Ubuntu, the killer was a module was not compatible with windows, so I have a new drive with Ubuntu. Need to get these modules to install. Something about "Make" folder destination, I think. – Cougar Jun 07 '19 at 22:27

2 Answers2

3

When downloading Perl modules with cpanminus you must have make installed.

sudo cpan App::cpanminus
sudo apt install make

Also, I had a module that kept failing to install. So I downloaded it, extracted it to its own folder.

Then I navigated to that folder and ran the make command.

It told me why it would not install: No GCC Compiler.

Once the compiler was installed, all modules downloaded and installed sucessfully!

Hope this helps someone.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
Cougar
  • 119
0

Since /usr/local/share/perl/5.26.1 and /usr/local/bin are "System" directories, regular users don't have write access to them.

The easiest fix to to run cpanm as root, with

sudo cpanm AnyEvent
waltinator
  • 36,399
  • $ sudo cpanm AnyEvent < tried it!

    [sudo] password for cougar:

    --> Working on AnyEvent Fetching http://www.cpan.org/authors/id/M/ML/MLEHMANN/AnyEvent-7.15.tar.gz ... OK ==> Found dependencies: Canary::Stability --> Working on Canary::Stability Fetching http://www.cpan.org/authors/id/M/ML/MLEHMANN/Canary-Stability-2013.tar.gz ... OK Configuring Canary-Stability-2013 ... OK

    – Cougar Jun 07 '19 at 22:35
  • ! Can't configure the distribution. You probably need to have 'make'. See /home/cougar/.cpanm/work/1559946694.11696/build.log for details. ! Installing the dependencies failed: Module 'Canary::Stability' is not installed ! Bailing out the installation for AnyEvent-7.15.

    I know and believe it will be a simple fix, thanks!

    – Cougar Jun 07 '19 at 22:36
  • Is it possible I have a bad install of Ubuntu? – Cougar Jun 07 '19 at 22:43
  • It maybe some ftp servers are down, getting 404 on some links. I believe that would cause installs to fail! Also I do not care where I get the modules so long as they are the same. and install@ – Cougar Jun 08 '19 at 00:01
  • *******Update**************

    Modules have downloaded and installed, just need to tell the OS where they are installed!

    – Cougar Jun 08 '19 at 12:30