How can I install Perl module without using CPAN.pm?

后端 未结 10 1557
庸人自扰
庸人自扰 2021-02-01 21:27

Is it possible?

相关标签:
10条回答
  • 2021-02-01 21:36

    If you're asking this because you're having problems with CPAN... you're probably running out of RAM that's why you can't use CPAN.

    Maybe you don't have a swap file. Try this:

    $ sudo su
    # dd if=/dev/zero of=/swap bs=1M count=1k # create a 1GB file
    # mkswap /swap
    # swapon /swap
    

    Otherwise... stop some services.

    $ sudo service mysql stop
    $ sudo service nginx stop
    

    ...And try again

    $ cpan install CPAN
    $ cpan install MIME::Lite::TT::HTML
    
    0 讨论(0)
  • 2021-02-01 21:37

    We can install all perl modules both from and even with your terminal in ubuntu. If you are using a ubuntu server then execute the following command , 'sudo apt-get install "perl_module"' The modules which you want just give the name in "perl_module" means If you want to install Apache2::Cookie it will be in "libapreq2" so you have to give like, "sudo apt-get install libapreq2"

    0 讨论(0)
  • 2021-02-01 21:38

    If you are using Red Hat (Fedora, CentOS), you should use RPM for Perl dependencies wherever possible. Perl packages are almost always named perl-Module-Name, e.g. perl-DBI, perl-Spreadsheet-WriteExcel, etc.

    On Ubuntu the naming scheme is libmodule-name-perl.

    0 讨论(0)
  • 2021-02-01 21:43

    If you download the source code, and read the README file. This will probably tell you you should do

    perl Makefile.PL
    make
    make test
    make install
    

    or

    perl Build.PL
    ./Build
    ./Build test
    ./Build install
    
    0 讨论(0)
  • 2021-02-01 21:44

    I, as others have would highly suggest using CPAN.pm. It is a breeze to use and can resolve any dependencies associated with the module you need automatically.

    On the other hand, I would suggest that you read the perlmodinstall document over at perldoc as it gives details on other os' as well.

    Regards,

    Jeff

    0 讨论(0)
  • 2021-02-01 21:45

    See here: How to install perl modules using CPAN without root

    I have just set this up on a server without root access and CPAN does everything automatically.

    But if you really wanna install a module without CPAN and you don't have root (assuming this since you don't wanna use CPAN), you can do it as follows

    perl Makefile.PL PREFIX=$HOME
    make
    make install
    

    You're gonna have to hunt down dependencies yourself so it's better to use CPAN.

    0 讨论(0)
提交回复
热议问题