3

I was trying to install a perl module Future::Utils on my Ubuntu machine but didn't find the exact command. I tried this command but it didn't work:

sudo apt-get install libfuture-utils-perl

I have this result when i run this command:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libfuture-perl

Can you help me resolve this issue

  • What happened when you ran that apt-get command? Please edit your question to include this information, including any error messages you may have got. – roaima Jun 15 '15 at 13:47
4

On my Debian system running your command gave me this result

apt-get install libfuture-utils-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libfuture-utils-perl

However, I found the library was available as a package by searching:

apt-cache search libfuture
libfuture-perl - module for operations awaiting completion

I was then able to install it:

apt-get install libfuture-perl
  • If it's not a built package then cpan install Future::Utils will probably do the trick. – Sobrique Jun 15 '15 at 14:02
  • @Sobrique good point, but since the package exists there's little reason at the outset for not using it. (Good contra-reasons include CPAN having a significantly newer version.) – roaima Jun 15 '15 at 14:18
  • @roaima Thankyou for your answer i try to install libfuture-perl and I have the same error – toto Jun 15 '15 at 14:31
  • What result do you get from the apt-cache command I suggested? Have you run apt-get update recently? – roaima Jun 15 '15 at 15:12
0

Perl module names correspond to a .pm file path out of a necessity -- not any specific rule of the languague, but because that's how perl finds them. This assumption can be used with apt-file search to determine which distro package, if any, contains that file:

apt-file search  "/Future/Utils.pm"

There are a lot of modules with no package, however, and the easiest way to get those is directly from CPAN, for which the cpan utility provides an interactive interface. It is probably already installed if perl is. The first time you use it, it will ask to do a bit of auto-configuration. You probably want to su root first, so that you can install to the system rather than a user home, and so the cpan config is saved in the right place (root's home directory). Then you just install Future::Utils from the cpan prompt. Installing a module this way may require build tools if there is XS code involved; cpan will let you know about this and tell you what you need to install first. You may also sometimes require specific libraries and the development header packages for them.

You can have multiple versions of a module installed, one from a distro package and one from CPAN, since they go to different places by default. The CPAN one is what will get used, however, since its path takes precedence in the @INC array -- but you can change this or set $PERL5LIB (a shell environment, not perl, variable).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.